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

if Grid / Client-side Binding and Caching NOT Fire Click Envent

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nanthakumar thangavel
Top achievements
Rank 1
nanthakumar thangavel asked on 12 Aug 2010, 07:23 AM
I binded data to radgrid using webservice but GridEditCommandColumn & GridButtonColumn  click event  not fire

 
<telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" GridLines="None"
    OnItemCommand="RadGrid1_ItemCommand">
    <MasterTableView DataKeyNames="Id" ClientDataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Firstname" HeaderText="Firstname" DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Lastname" HeaderText="Lastname" DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Age" HeaderText="Age" DataType="System.Int32">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                ButtonType="ImageButton">
            </telerik:GridButtonColumn>
        </Columns>
        <PagerStyle Mode="Slider" />
    </MasterTableView>
    <ClientSettings>
        <DataBinding SelectMethod="GetSampleData" Location="Webservice/GridData.svc" SortParameterType="String">
        </DataBinding>
    </ClientSettings>
</telerik:RadGrid>

However when clicking on the appropriate button on a grid row the event isn't fired, basically no postback to the server is being done. A solution I found is to add the "EnablePostBackOnRowClick=true" to the ClientSettings, but this would cause a postback on each click on a row, which is not really desired.

Is there a better way to realizing this or does anybody have a hint what could be the problem??

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 17 Aug 2010, 09:07 AM
Hello,

I'm afraid that such scenario is currently not supported when using automatic client-side databinding. Therefore you should consider using manual client-side databinding instead.

All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
nanthakumar thangavel
Top achievements
Rank 1
answered on 17 Aug 2010, 09:51 AM
Hi

i solved the above issues  and here attached my modified code 

 if we use imagebutton/link Button in GridTemplateColumn instead of default button like   GridEditCommandColumn  and  GridButtonColumn.  its working well and events fired


Thanks for Response


 
<telerik:RadGrid runat="server"ID="RadGrid1"AllowPaging="True"AllowSorting="True"
    AutoGenerateColumns="False"GridLines="None"
    OnItemCommand="RadGrid1_ItemCommand">
    <MasterTableView DataKeyNames="Id"ClientDataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Firstname"HeaderText="Firstname"DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Lastname"HeaderText="Lastname"DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Age"HeaderText="Age"DataType="System.Int32">
            </telerik:GridBoundColumn>
           
<telerik:GridTemplateColumn UniqueName="EditColumn">       
            <ItemTemplate>
                <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/images/EditRecord.gif" CommandName= "Edit"  />       
            </ItemTemplate>
       </telerik:GridTemplateColumn>
       <telerik:GridTemplateColumn UniqueName="DeleteColumn">
             <ItemTemplate>
                 <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/images/DeleteRecord.gif" CommandName= "Delete" OnClientClick="javascript:return confirm('Are you sure to delete?')" />     
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        </Columns>
        <PagerStyle Mode="Slider"/>
    </MasterTableView>
    <ClientSettings>
        <DataBinding SelectMethod="GetSampleData"Location="Webservice/GridData.svc"SortParameterType="String">
        </DataBinding>
    </ClientSettings>
</telerik:RadGrid>
Tags
Grid
Asked by
nanthakumar thangavel
Top achievements
Rank 1
Answers by
Rosen
Telerik team
nanthakumar thangavel
Top achievements
Rank 1
Share this question
or