naveen veda
Top achievements
Rank 1
naveen veda
asked on 10 Jul 2009, 06:42 AM
Hi,
I am using RadGrid control for ASp.net Ajax, i given Radgrid page size is 50 and vertical line for columns it is working fine, but if two records are displayed in RadGrid the vertical line are hanging for two record,how to complte that,
how to give last row buttom border for RadGrid control asp.net ajax?
I am using RadGrid control for ASp.net Ajax, i given Radgrid page size is 50 and vertical line for columns it is working fine, but if two records are displayed in RadGrid the vertical line are hanging for two record,how to complte that,
how to give last row buttom border for RadGrid control asp.net ajax?
3 Answers, 1 is accepted
0
Hi naveen,
If I understood you correctly, your RadGrid height is greater than the items displayed when you have only 2 items, and you need to set the item bottom border for the last item. You can do it in RadGrid's PreRender event:
Alternatively, you can set the item's CSS class and style it from there:
And the CSS:
Regards,
Veli
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
If I understood you correctly, your RadGrid height is greater than the items displayed when you have only 2 items, and you need to set the item bottom border for the last item. You can do it in RadGrid's PreRender event:
void RadGrid1_PreRender(object sender, EventArgs e) |
{ |
GridDataItem lastItem = RadGrid1.MasterTableView.Items[RadGrid1.MasterTableView.Items.Count - 1]; |
foreach (TableCell cell in lastItem.Cells) |
{ |
cell.Style["border-bottom"] = "1px solid red"; |
} |
} |
Alternatively, you can set the item's CSS class and style it from there:
void RadGrid1_PreRender(object sender, EventArgs e) { GridDataItem lastItem = RadGrid1.MasterTableView.Items[RadGrid1.MasterTableView.Items.Count - 1]; if (lastItem.ItemIndex % 2 == 0) { lastItem.CssClass = "rgRow borderBottom"; } else { lastItem.CssClass = "rgAltRow borderBottom"; } }
And the CSS:
div.RadGrid .borderBottom td |
{ |
border-bottom-color:red; |
} |
Regards,
Veli
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gino Suarez
Top achievements
Rank 1
answered on 04 Dec 2009, 10:51 PM
HI, it works great but when i try to put the border-top , the grid doesn't show the line
with border-bottom works fine.
Regards Gino
protected void tk_Grid_ItemDataBound(object sender, GridItemEventArgs e) |
if (e.Item is GridGroupFooterItem) |
{ |
GridGroupFooterItem groupItem = (GridGroupFooterItem)e.Item; |
groupItem["GananciaPorFuncion"].Style["border-top"] = "1px solid blue"; |
} |
with border-bottom works fine.
Regards Gino
0
Hi Gino Suarez,
Best wishes,
Veli
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
RadGrid's Skin CSS probably overrides the border-top style. You can use the following CSS class instead:
div.RadGrid table.rgMasterTable td.rgFooter
{
border-top
:
1px
solid
blue
;
}
Best wishes,
Veli
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.