Dear,
I want to add new row by pressing the tab key when the cursor is in the last cell row of the radgrid,and the grid automatically create a new row.
Please see the attached file.
Thank you,
Truc Nguyen
I want to add new row by pressing the tab key when the cursor is in the last cell row of the radgrid,and the grid automatically create a new row.
Please see the attached file.
Thank you,
Truc Nguyen
3 Answers, 1 is accepted
0
Hello Truc,
I suggest you examine this online demo and see if this approach would be applicable for you.
Regards,
Pavlina
Telerik
I suggest you examine this online demo and see if this approach would be applicable for you.
Regards,
Pavlina
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.
0
Truc
Top achievements
Rank 1
answered on 06 Jul 2013, 02:09 PM
Hi Pavlina,
Thanks for your answer.
I am using Radgrid into User Control. that user control defined into RadWindow in aspx page.
But radgrid.get_masterTableView() return null values. i want to assign datasource only in client side.
Please let me know how to solve this issue.
Here i have attached code:
in aspx page (called by RadWindow):
in javascript:
Thanks for your answer.
I am using Radgrid into User Control. that user control defined into RadWindow in aspx page.
But radgrid.get_masterTableView() return null values. i want to assign datasource only in client side.
Please let me know how to solve this issue.
Here i have attached code:
in aspx page (called by RadWindow):
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> </telerik:RadScriptManager> <telerik:RadGrid ID="RadGrid1" runat="server" onneeddatasource="RadGrid1_NeedDataSource" onitemdatabound="RadGrid1_ItemDataBound" onitemcommand="RadGrid1_ItemCommand" ClientIDMode="Static" AutoGenerateColumns="False" GridLines="None"> <ClientSettings> <ClientEvents OnCommand="RadGrid_Command" /> </ClientSettings> <MasterTableView DataKeyNames="IsAdd,WORKCODE" CommandItemDisplay="Top"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="WORKCODE" DataField="WORKCODE" HeaderText="STT" > <ItemTemplate> <asp:Label ID="Label8" runat="server" Text='<%# Eval("WORKCODE") %>'>></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="CONTENT" DataField="CONTENT" HeaderText="Nội dung công việc" > <ItemTemplate> <asp:Label ID="Label9" runat="server" Text='<%# Eval("CONTENT") %>'></asp:Label> <asp:TextBox ID="TextBox2" Text='<%# Eval("CONTENT") %>' runat="server"></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="DAILYREPORT" DataField="DAILYREPORT" HeaderText="Báo cáo ngà y" > <ItemTemplate> <asp:CheckBox ID="CheckBox1" Checked='<%# (Boolean.Parse(Eval("DAILYREPORT").ToString())) ? true : false %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="WEEKLYREPORT" DataField="WEEKLYREPORT" HeaderText="Báo cáo tuần" > <ItemTemplate> <asp:CheckBox ID="CheckBox2" Checked='<%# (Boolean.Parse(Eval("WEEKLYREPORT").ToString())) ? true : false %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="MONTHLYREPORT" DataField="MONTHLYREPORT" HeaderText="Báo cáo tháng" > <ItemTemplate> <asp:CheckBox ID="CheckBox3" Checked='<%# (Boolean.Parse(Eval("MONTHLYREPORT").ToString())) ? true : false %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="YEARLYREPORT" DataField="YEARLYREPORT" HeaderText="Báo cáo năm" > <ItemTemplate> <asp:CheckBox ID="CheckBox4" Checked='<%# (Boolean.Parse(Eval("YEARLYREPORT").ToString())) ? true : false %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="OCASSIONREPORT" DataField="OCASSIONREPORT" HeaderText="Báo cáo năm" > <ItemTemplate> <asp:CheckBox ID="CheckBox5" Checked='<%# (Boolean.Parse(Eval("OCASSIONREPORT").ToString())) ? true : false %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="WORKLOAD" DataField="WORKLOAD" HeaderText="Mức độ C.Việc" > <ItemTemplate> <asp:Label ID="Label10" runat="server" Text='<%# Eval("WORKLOAD") %>'></asp:Label> <asp:TextBox ID="TextBox3" Text='<%# Eval("WORKLOAD") %>' runat="server"></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> <ItemStyle Font-Names="Arial" /> </MasterTableView> <FilterMenu EnableImageSprites="False"></FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu> </telerik:RadGrid>in javascript:
function createNewRow() { var grid = $find("RadGrid1"); //using static clientId console.log(grid); // ---> OK var masterTable = grid.get_masterTableView(); console.log(masterTable); // ------> NULL ????? masterTable.insertItem(); return false; } function RadGrid_Command(sender, args) { }0
Hi Truc,
I suggest you refer to the following thread which elaborates on similar problem:
http://www.telerik.com/community/forums/aspnet-ajax/grid/get-mastertableview-is-null-for-radgrid-from-usercontrol.aspx
Regards,
Pavlina
Telerik
I suggest you refer to the following thread which elaborates on similar problem:
http://www.telerik.com/community/forums/aspnet-ajax/grid/get-mastertableview-is-null-for-radgrid-from-usercontrol.aspx
Regards,
Pavlina
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.