HI,
We came across your control set when we are in process of evaluating various control sets comprising of Grid, Calender, Splitter and Input Boxes. One of my developers downloaded the trial version of your AJAX Grid and was trying to create a grid that looks similar to the attached sketch and is having some trouble. A quick response would help us make a quicker decision regarding the control set.
I'm having trouble using ItemTemplate to enter one record from table as two rows min and max as each limit is a range, and EditItemTemplate for creating and New/Edit form.
An ASPX Sample hard coded datatable would be a great help.
Grid Sketch
http://www.telerik.com/ClientsFiles/121943_grid-sample.bmp
Thanks,
Tejas Patel
We came across your control set when we are in process of evaluating various control sets comprising of Grid, Calender, Splitter and Input Boxes. One of my developers downloaded the trial version of your AJAX Grid and was trying to create a grid that looks similar to the attached sketch and is having some trouble. A quick response would help us make a quicker decision regarding the control set.
I'm having trouble using ItemTemplate to enter one record from table as two rows min and max as each limit is a range, and EditItemTemplate for creating and New/Edit form.
An ASPX Sample hard coded datatable would be a great help.
Grid Sketch
http://www.telerik.com/ClientsFiles/121943_grid-sample.bmp
Thanks,
Tejas Patel
5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 23 Mar 2009, 07:17 AM
Hello Tejas,
To display one record in two rows of your grid, the best approach would be to use a GridTemplateColumn. You can place a table structure with two rows in the ItemTemplate of the TemplateColumn to display subrows in a single row. Also you can use a formtemplate to customize the EditForm of your grid.
Thanks
Princy.
To display one record in two rows of your grid, the best approach would be to use a GridTemplateColumn. You can place a table structure with two rows in the ItemTemplate of the TemplateColumn to display subrows in a single row. Also you can use a formtemplate to customize the EditForm of your grid.
Thanks
Princy.
0

Tejas
Top achievements
Rank 1
answered on 24 Mar 2009, 02:50 PM
thanks for the reply. The grid disappears when I click on edit or try to sort. I have attached the sample code. Thanks for your help!
<telerik:RadGrid id="RadGrid1" runat="server" AllowSorting="True" AutoGenerateColumns="false"> |
<MasterTableView DataKeyNames = "StartCycleID> |
<Columns> |
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn> |
<telerik:GridBoundColumn DataField = "StartCycleID" HeaderText = "Start Cycle"/> |
<telerik:GridBoundColumn DataField = "EndCycleID" HeaderText = "End Cycle"/> |
<telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText=""> |
<ItemTemplate> |
<asp:Label runat="server" ID="lblBenefitMonth" Text = "Min"/> |
<asp:Label runat="server" ID="Label1" Text = "Max"/> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn UniqueName="PretaxTransit" HeaderText="Pretax Transit"> |
<ItemTemplate> |
<asp:Label runat="server" ID="lblPreTaxTransitMinAmount" Text = '<%# Bind("PreTaxTransitMinAmount") %>'/> |
<asp:Label runat="server" ID="lblPreTaxTransitMaxAmount" Text = '<%# Bind("PreTaxTransitMaxAmount") %>'/> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn UniqueName="PretaxTransit" HeaderText="Pretax Transit"> |
<ItemTemplate> |
<asp:Label runat="server" ID="PreTaxParkingMinAmount" Text = '<%# Bind("PreTaxParkingMinAmount") %>'/> |
<asp:Label runat="server" ID="PreTaxParkingMaxAmount" Text = '<%# Bind("PreTaxParkingMaxAmount") %>'/> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
<editformsettings editformtype="Template"> |
<formtemplate> |
<table> |
<thead> |
<tr> |
<td>Limit</td> |
<td>Min</td> |
<td>Max</td> |
</tr> |
</thead> |
<tr> |
<td>Pre Tax Transit</td> |
<td> |
<asp:TextBox runat = "server" ID = "TextBox1" Text='<%# Bind( "PreTaxTransitMinAmount") %>' /> |
</td> |
<td> |
<asp:TextBox runat = "server" ID = "TextBox2" Text='<%# Bind( "PreTaxTransitMaxAmount") %>' /> |
</td> |
</tr> |
<tr> |
<td>Pre Tax Transit</td> |
<td> |
<asp:TextBox runat = "server" ID = "TextBox3" Text='<%# Bind( "PreTaxParkingMinAmount") %>' /> |
</td> |
<td> |
<asp:TextBox runat = "server" ID = "TextBox4" Text='<%# Bind( "PreTaxParkingMaxAmount") %>' /> |
</td> |
</tr> |
</table> |
</formtemplate> |
</editformsettings> |
</MasterTableView> |
</telerik:RadGrid> |
0
Hello Tejas,
How do you DataBind the control? Can you please also provide the code-behind section?
All the best,
Yavor
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
How do you DataBind the control? Can you please also provide the code-behind section?
All the best,
Yavor
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0

Tejas
Top achievements
Rank 1
answered on 24 Mar 2009, 06:58 PM
Please view the code behind..
I'm am binding the grid only if it's not a postback. If i bind the gird on postbacks it works fine. But the we want to enable the viewstate and not bind the grid on ever postback.
I'm am binding the grid only if it's not a postback. If i bind the gird on postbacks it works fine. But the we want to enable the viewstate and not bind the grid on ever postback.
private CompanyLimitsDC companyLimitsDC; |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!IsPostBack) |
{ |
try |
{ |
switch (Business.Shared.Security.GetPermission(Activity.CompanyPreferences)) |
{ |
case PermissionType.Update: |
GetDataContainer(); |
DisplayMaintenanceForm(); |
break; |
case PermissionType.None: |
Response.Redirect("~/Error/AccessDenied.aspx", true); |
break; |
} |
} |
catch (Exception) |
{ |
throw; |
} |
} |
} |
private void DisplayMaintenanceForm() |
{ |
try |
{ |
while (irsLimitDC.IRSLimitDataReader.Read()) |
{ |
RadGrid1.DataSource = dtCompanyLimits; |
RadGrid1.DataBind(); |
} |
} |
catch (Exception ex) |
{ |
throw new UIException("DisplayMaintenanceForm", ex); |
} |
} |
private void GetDataContainer() |
{ |
try |
{ |
//TODO: remove hardcoded companyID after testing |
MySession.CompanyID = 35; |
#region Company limits |
companyLimitsDC = new CompanyLimitsDC(); |
companyLimitsDC.CompanyID = MySession.CompanyID; |
CompanyBWC.GetCompanyLimits(companyLimitsDC); |
dtCompanyLimits = companyLimitsDC.CompanyLimitDataReader.GetDataTable(); |
#endregion |
} |
catch (Exception ex) |
{ |
throw new UIException("GetDataContainer", ex); |
} |
} |
0
Hi Tejas,
You are using simple databinding for the grid - hence the behavior.
Please, utilize either NeedDataSource event handler, or a datasource control, to make sure the control's structure is properly maintained, and no such issues arise.
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
You are using simple databinding for the grid - hence the behavior.
Please, utilize either NeedDataSource event handler, or a datasource control, to make sure the control's structure is properly maintained, and no such issues arise.
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.