Click here to Skip to main content
15,891,714 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using Dev Exp Gridview, i waht to display the details in to textbox for selected row from aspxgridview.
please help me.............
Thanks,
Shashikant
Posted
Updated 2-Jul-19 0:41am

Hi Biradar,

Could you please contact our support team here and they can help you find a solution for that?
http://www.devexpress.com/Support/Center/CreateIssue.aspx?issuetype=Question[^]

Thanks!
-Mehul
 
Share this answer
 
Comments
shashikant.biradar 16-Nov-11 1:15am    
Hi Mehul,
I got the solution for my problem,
also i have updated my post with solution.....

Thanks for your reply.
Thanks,
Shashikant
Hi,
i got the solution for my problem,
just set the property of gridview
EnableCallBacks=False
aspx code

XML
<dx:ASPxGridView ID="dxGVUser" runat="server" AutoGenerateColumns="False"
                                                                                        ClientIDMode="AutoID" EnableCallBacks="False" KeyFieldName="UserId"
                                                                                        OnSelectionChanged="dxGVUser_SelectionChanged" Width="700px">
                                                                                        <Columns>
                                                                                            <dx:GridViewCommandColumn ShowInCustomizationForm="True" VisibleIndex="0">
                                                                                            </dx:GridViewCommandColumn>
                                                                                            <dx:GridViewDataTextColumn FieldName="UserId" Name="User Id"
                                                                                                ShowInCustomizationForm="True" VisibleIndex="2">
                                                                                            </dx:GridViewDataTextColumn>
                                                                                            <dx:GridViewDataTextColumn FieldName="UserName" Name="User Name"
                                                                                                ShowInCustomizationForm="True" VisibleIndex="3">
                                                                                            </dx:GridViewDataTextColumn>
                                                                                            <dx:GridViewDataTextColumn FieldName="FirstName" Name="First Name"
                                                                                                ShowInCustomizationForm="True" VisibleIndex="4">
                                                                                            </dx:GridViewDataTextColumn>
                                                                                            <dx:GridViewDataTextColumn Caption="Last Name" FieldName="LastName"
                                                                                                Name="Last Name" ShowInCustomizationForm="True" VisibleIndex="5">
                                                                                            </dx:GridViewDataTextColumn>
                                                                                            <dx:GridViewDataTextColumn Caption="Middle Name" FieldName="MiddleName"
                                                                                                Name="Middle Name" ShowInCustomizationForm="True" VisibleIndex="6">
                                                                                            </dx:GridViewDataTextColumn>
                                                                                        </Columns>
                                                                                        <SettingsBehavior AllowFocusedRow="True" AllowSelectByRowClick="True"
                                                                                            AllowSelectSingleRowOnly="True" ProcessSelectionChangedOnServer="True" />
                                                                                    </dx:ASPxGridView>

<asp:textbox id="txtUserName" runat="server" width="180px" xmlns:asp="#unknown"></asp:textbox>




CS Code

C#
protected void dxGVUser_SelectionChanged(object sender, EventArgs e)
       {


           txtUserName.Text = dxGVUser.GetSelectedFieldValues("UserName")[0].ToString();


       }
 
Share this answer
 
On RowCommand of gridview
C#
protected void select_empl(object sender, GridViewCommandEventArgs e)
    {
        int index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row = GridView1.Rows[index];
        txtemployeecode.Text=row.Cells[1].Text;
        txtemployeename.Text=row.Cells[2].Text;

    }

Hope it helps
Note: It is for ASP.Net GridView.
 
Share this answer
 
Comments
shashikant.biradar 9-Nov-11 23:36pm    
Hi Uma Shankar, Thnaks for your reply, yes you are right its work for normal asp.net grid, but my problem is with Third party control DevExpress APSXGridView. please help me in the same
Yes, take a look at this demo:
http://demos.devexpress.com/ASPxGridViewDemos/Selection/Selection.aspx[^]

The Source code is available from the 'Code' tab at the top right.

Thanks.
Mehul Harry
 
Share this answer
 
Comments
shashikant.biradar 9-Nov-11 23:33pm    
Hi Mehul,
thanks for your reply,
I have already gone through the abouve url,
-->this url give detail when i select row it runs for loop, then checks for selected row then it displays the first column details.

-->but my problem is that i wanted to display the row details in text box.
in normal VS 2010 grid when we click the row we will get selectedindexchanged event from server side. then we write simple code to get row details
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
txtemployeecode.Text=row.Cells[1].Text;
txtemployeename.Text=row.Cells[2].Text;
some thing like this..

--> so please provide me the working example where i can display all columns(4 or 5) details in to textbox on server side

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900