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

Get GridDataItem in RadGrid ItemRequested Event

0 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sachin
Top achievements
Rank 1
sachin asked on 15 Nov 2017, 03:24 PM

Hi,

I am facing issue to getting GridDataItem on ItemRequested Event. My scenario is

In RadGrid, EditItemTemplate has one RadComboBox "rcbEmployee" and this RadComboBox bind on rcbEmployee_ItemsRequested event by calling one method "GetEmployee" that fatch the employee list to bind RadComboBox.

But "GetEmployee" method needed some parameter those can be get by GridDataItem. 

So How can I access GridDataItem on "rcbEmployee_ItemsRequested" event or is there any work around ?

<telerik:RadGrid ID="RadGrid12" runat="server" MasterTableView-DataKeyNames="iIndex,pEmployee,FirstName" MasterTableView-ClientDataKeyNames="iIndex,pEmployee,FirstName"
                EnableLinqExpressions="false" ClientSettings-EnableRowHoverStyle="true" Width="100%" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" OnNeedDataSource="RadGrid1_NeedDataSource"
                AllowMultiRowSelection="true" AllowAutomaticUpdates="True" AutoGenerateColumns="False" >
                <MasterTableView GridLines="Both" HeaderStyle-HorizontalAlign="Center" AutoGenerateColumns="false"
                    CommandItemDisplay="None" HorizontalAlign="NotSet">
                     <Columns>
                        <telerik:GridTemplateColumn DataField="FirstName" ItemStyle-Width="200px" HeaderStyle-Width="200px" HeaderText="Name" UniqueName="FirstName">
                            <ItemTemplate>
                                <asp:Label ID="lblFirstName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="rcbEmployee" EnableLoadOnDemand="True" DataTextField="Name" DataValueField="iIndex"
                                    OnItemsRequested="rcbEmployee_ItemsRequested" AutoPostBack="false" HighlightTemplatedItems="true" Height="300px" Width="180px" DropDownWidth="180px">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container, "Text")%>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                            </EditItemTemplate>
                            <FilterTemplate></FilterTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

 

Please help.

Thanks,

Sachin

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
sachin
Top achievements
Rank 1
Share this question
or