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

RadGrid GridClientSelectColumn server side selected

1 Answer 264 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cagdas
Top achievements
Rank 1
Cagdas asked on 10 Dec 2013, 03:37 PM
Hi Telerik developers;

This problem RadGrid in radwindow open in server side GridClientSelectColumn selected

Gird in Columns
<Columns>
                       <telerik:GridClientSelectColumn UniqueName="chkSelectColumn" HeaderStyle-Width="20px"></telerik:GridClientSelectColumn>
                       <telerik:GridBoundColumn DataField="CekKartID" HeaderText="ID" ReadOnly="true" ShowFilterIcon="false" Display="false" UniqueName="CekKartID"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="CekNo" HeaderText="Çek No" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="BankaAdi" HeaderText="Banka Adi" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="AlinanCari" HeaderText="Alinan Cari Unvan" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="VadeTarihi" HeaderText="Vade Tarihi" FilterControlWidth="80%" ShowFilterIcon="false" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
                       <telerik:GridNumericColumn DataField="Tutar" HeaderText="Tutar" DataFormatString="{0:N}" Aggregate="Sum" FilterControlWidth="20%" ShowFilterIcon="false" HeaderStyle-Width="100px" />
                   </Columns>


C# is Radgrid item data bound
protected void grdPortCekIade_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridDataItem)
           {
 
               GridDataItem dataBoundItem = e.Item as GridDataItem;
 
               var rowID= dataBoundItem["CekKartID"].Text;
                
                //sesCekKart = session in CekKart Table
               if (Convert.ToInt32(rowID) == sesCekKart.CekKartID)
               {
                   CheckBox chk = (CheckBox)dataBoundItem["chkSelectColumn"].Controls[0];                   
                   chk.Checked = true;
               }
           }
 
 
       }

RadWindow open and grid columns no selected GridClientSelectColumn
I want you selected the selected object
This radwindow image in click


1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 13 Dec 2013, 10:03 AM
Hi Cagdas,

For selecting the row in your scenario you will have to use different approach, since changing the Checked property of the CheckBox control will not do the trick.

Could you please try changing your ItemDataBound event handler with the following and see if it works as expected on your end:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataBoundItem = e.Item as GridDataItem;
 
        var rowID = dataBoundItem["CekKartID"].Text;
        if (Convert.ToInt32(rowID) == sesCekKart.CekKartID)
        {
            dataBoundItem.Selected = true;
        }
    }
}

Hope that helps.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Cagdas
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or