Hello Everyone,
I am using RadControls for ASP.NET AJAX Q2 2009 SP1 with Visual Studio 2008 SP1. I have a 2 level (Master/Detail) RadGrid. For my Project I am using the below Grid/Command Item Demo as a prototype.
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx
My question's are:
1) How do I add a new LinkButton in command item template to Print individual row like Edit selected from above Grid Demo?
2) I would like if I click that print button, it will print Master as well as all related Detail rows for that selected row.
Any example or help will be appreciated. Thanks
<telerik:RadTreeView ID="tvCategories" runat="server" Skin="Default" Width="200" DataTextField="Title" DataFieldParentID="ParentId" DataFieldID="Id"></telerik:RadTreeView>protected void Page_Load(object sender, EventArgs e) { tvCategories.DataSource = common.GetProductCategories(); tvCategories.DataBind(); }<div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;"> <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true"> <tabs> <telerik:radtab text="First Tab" value="First Tab" /> </tabs> </telerik:radtabstrip></div><input type="button" value="Insert Tab" onclick="onInsertTab()" /><script type="text/javascript" language="javascript"> function onInsertTab() { var tabStrip = $find('rts2'); var tab = new Telerik.Web.UI.RadTab(); tab.set_text("Inserted Tab"); var tabList = tabStrip.get_tabs(); // change the call below to "tabList.add(tab)" and it all works ok tabList.insert(0, tab);}</script><div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;"> <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true"> <tabs> <telerik:radtab text="First Tab" value="Tab1" /> <telerik:radtab text="Second Tab" value="Tab2" /> <telerik:radtab text="Third Tab" value="Tab3" /> <telerik:radtab text="Fourth Tab" value="Tab4" /> <telerik:radtab text="Fifth Tab" value="Tab5" /> <telerik:radtab text="Sixth Tab" value="Tab6" /> </tabs> </telerik:radtabstrip></div><input type="button" value="Remove Tab" onclick="onRemoveTab()" /><script type="text/javascript" language="javascript"> function onRemoveTab() { var tabStrip = $find('rts2'); var tab = tabStrip.get_tabs().getTab(0); if (tab) tabStrip.get_tabs().remove(tab); }Every time I think I'm close to getting the tabstrip to work I find another bug! Here's the latest one...
Add a RadTabStrip to the page with the ScrollChildren property set true, and initialise it with enough items to ensure the scrollbar is visible.
Now append a new item to the bar using a client-side "add" function. It ignores the scroll bar setting and starts a new row of tabs instead.
Here's a simple code snippet that demonstrates this
<div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;"> <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true"> <tabs> <telerik:radtab text="First Tab" value="Tab1" /> <telerik:radtab text="Second Tab" value="Tab2" /> <telerik:radtab text="Third Tab" value="Tab3" /> <telerik:radtab text="Fourth Tab" value="Tab4" /> <telerik:radtab text="Fifth Tab" value="Tab5" /> <telerik:radtab text="Sixth Tab" value="Tab6" /> </tabs> </telerik:radtabstrip></div><input type="button" value="Insert Tab" onclick="onInsertTab()" /><script type="text/javascript" language="javascript"> function onInsertTab() { var tabStrip = $find('rts2'); var tab = new Telerik.Web.UI.RadTab(); tab.set_text("Inserted Tab"); var tabList = tabStrip.get_tabs(); tabList.add(tab); }tlCategories.Columns[0].HeaderText = common.RM.GetString("ctName");RadGrid2.ItemCreated += new GridItemEventHandler(RadGrid2_ItemCreated);OnItemCreated="RadGrid2_ItemCreated">protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e) { if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) { GridEditableItem edititem = (GridEditableItem)e.Item; TextBox txtbx = (TextBox)edititem["Donor_ID"].Controls[0]; txtbx.Width = Unit.Pixel(50); } }