This is a migrated thread and some comments may be shown as answers.

Grid Row Select value not passed on radtextbox

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 22 Nov 2012, 11:09 AM

Hi Friends,

Here i have written code like this




<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" ShowFooter="True"
            Style="outline: 0" GroupingEnabled="true" ShowGroupPanel="true" AutoGenerateColumns="False"
            AllowSorting="True" PageSize="15" Width="90%" GridLines="None" CellPadding="0"
            OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Black" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
            <MasterTableView ClientDataKeyNames="ResourceName,MobileNo ,EMail ,CreatedBy ,CreatedOn"
                AutoGenerateColumns="false" ShowFooter="true" AllowFilteringByColumn="true" PagerStyle-Mode="NextPrevAndNumeric"
                TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn DataField="ResourceName" HeaderText="Resource Name" UniqueName ="ResourceName" CurrentFilterFunction="equalto"
                        FilterDelay="1000" ShowFilterIcon="false" HeaderStyle-Width="120px" FilterControlWidth="105px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MobileNo" HeaderStyle-Width="110px" HeaderText="Mobile"
                        FilterControlWidth="70px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="EMail" UniqueName ="email" HeaderStyle-Width="190px" HeaderText="E-Mail"
                        FilterControlWidth="120px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CreatedBy" HeaderText="Created By" CurrentFilterFunction="equalto"
                        FilterDelay="1000" ShowFilterIcon="false" FilterControlWidth="70px">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn DataField="CreatedOn" HeaderText="Created On" DataFormatString="{0:d}"
                        PickerType="DatePicker" FilterControlWidth="70px">
                    </telerik:GridDateTimeColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="true" AllowDragToGroup="true"
                AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">
                <Selecting AllowRowSelect="True"></Selecting>
                 
                <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true">
                </Animation>
            </ClientSettings>
        </telerik:RadGrid>


protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
       {
           GridDataItem selectedItem = (GridDataItem)RadGrid1.SelectedItems[0];
           //
           txt_name.Text = selectedItem["ResourceName"].Text;
           txt_email.Text = selectedItem["email"].Text;
       }

Here the radgrid row select value not binded in rad textbox.Pls provide me the solution  soon ,I stuck up with this issue for nearly three days

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Nov 2012, 11:48 AM
Hi,

I guess you want to bind text in an external RadTextBox(RadTextBox outside the RadGrid) in RadGrid's SelectedIndexChanged event.
Try ajaxifiying the RadTextBoxes and RadGrid  as follows.

ASPX:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"/>
            </UpdatedControls>
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="txt_name" />
            </UpdatedControls>
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="txt_email" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Thanks,
Princy.
0
ALEX
Top achievements
Rank 1
answered on 23 Nov 2012, 05:57 AM
Thanks princy,it works
Tags
Grid
Asked by
ALEX
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
ALEX
Top achievements
Rank 1
Share this question
or