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

[Solved] Please help me in radgrid

4 Answers 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ali
Top achievements
Rank 1
ali asked on 23 Jun 2009, 12:46 PM
hi 
when i use EnableClientKeyValues="true" in radgrid , i give a error with this content:
this property is not member of radgrid in clientsettings
should set something in web.config???????? or any thing please help me

i use radgrid 2008 and mayradgrid has not this property

very thanks

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Jun 2009, 01:39 PM
Hello Ali,

The ClientSettings>EnableClientKeyValues property is available with the Asp.Net(Classic) version of RadGrid. For the Asp.Net Ajax(Prometheus) version of RadGrid, you can set the ClientDataKeyNames to the desired datafield, for which you would want to access the keyvalues.

aspx:
 <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="Sqldatasource1" > 
                <MasterTableView ClientDataKeyNames="ProductID" DataSourceID="Sqldatasource1"

Thanks
Princy.
0
ali
Top achievements
Rank 1
answered on 24 Jun 2009, 03:40 AM
hi very thanks Princy from your answer
i use from clientdatakeynames but give error


i bind datagrid in codebehind
my code is:
 function RowSelected(rowObject)
    {
            
              alert(rowObject.KeyValues["C14_ID"]);    
    }


       <telerik:RadGrid ID="RadGrid1"  runat="server" AutoGenerateColumns="False"  EnableAJAX="true" 
                GridLines="None" Width="100%">
       <MasterTableView  clientdatakeynames="C14_ID">

       <ClientSettings >
            <ClientEvents OnRowClick="RowSelected"  OnGridCreated="GridCreated" />
        </ClientSettings>
my error is :
KeyValues.C14_ID is null or notan object
0
Princy
Top achievements
Rank 2
answered on 24 Jun 2009, 04:51 AM
Hello Ali,

Which version of RadGrid are you using - RadGrid for Asp.Net or RadGrid for Asp.Net Ajax?
 If you are using RadGrid for Asp.Net(i.e., classic) version then you have to set the ClientSettings -> EnableClientKeyValues grid property to true and thus extract the respective field value for row through the KeyValues array passing the unique name of grid column. Check out the following help document which explains how to go about this:
Extracting key values client-side(classic)




If you are using RadGrid for Asp.Net Ajax(i.e., prometheus) version then you have to add the value of the required DataField to the ClientDataKeyNames array of the MasterTableView. RadGrid then makes that column's value available through the getDataKeyValue() function of the GridDataItem client-side object, to which the UniqueName of the column should be passed as an argument. Check out the following help document which explains how to get this done:
Extracting key values client-side(prometheus)

Regards
Princy.
0
ali
Top achievements
Rank 1
answered on 24 Jun 2009, 04:57 AM
hi Princy
very very thanks i get answer from you
good luck
Tags
Grid
Asked by
ali
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
ali
Top achievements
Rank 1
Share this question
or