or
<telerik:RadChart ID="RadChart1" runat="server" DefaultType="StackedBar"> <PlotArea> <YAxis MaxValue="300" Step="10" AutoScale="True" AxisMode="Extended"> </YAxis> </PlotArea> <Series> </Series> </telerik:RadChart>string sql = string.Format("...");DataTable openLeads = db.FillTable(sql);if (openLeads.Rows.Count > 0){ RadChart1.DataSource = openLeads; foreach (DataRow row in openLeads.Rows) { ChartSeries chrtSeries = new ChartSeries {Name = row["Description"].ToString()}; chrtSeries.Type = ChartSeriesType.StackedBar; RadChart1.SeriesOrientation = ChartSeriesOrientation.Vertical; RadChart1.Series.Add(chrtSeries); } RadChart1.PlotArea.XAxis.DataLabelsColumn = "UserName"; RadChart1.DataBind();}<telerik:GridAttachmentColumn MaxFileSize="1048576" EditFormHeaderTextFormat="Download File:" HeaderText="Download" AttachmentKeyFields="AudioID" FileNameTextField="AudioPath" DataTextField="SongTitle" UniqueName="AttachmentColumn"> </telerik:GridAttachmentColumn><ClientSettings> <ClientEvents OnCommand="gridCommand" /> </ClientSettings>function gridCommand(sender, args) { if (args.get_commandName() == "DownloadAttachment") { var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>'); manager.set_enableAJAX(false); setTimeout(function () { manager.set_enableAJAX(true); }, 0); } }protected void RadGridAudio_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.DownloadAttachmentCommandName) { e.Canceled = true; GridDownloadAttachmentCommandEventArgs args = e as GridDownloadAttachmentCommandEventArgs; string fileName = args.FileName; long attachmentId = (int)args.AttachmentKeyValues["AudioID"]; BusinessLayer.RegistrationAudio audio = new RegistrationAudio(); audio = registrationManager.GetRegistrationAudio(attachmentId); string filePath = audio.AudioPath.Substring(0, audio.AudioPath.LastIndexOf(@"\")); string _DownloadableProductFileName = audio.FileName; if (audio.AudioPath != null && audio.FileName != null) { System.IO.FileInfo FileName = new System.IO.FileInfo(filePath + "\\" + _DownloadableProductFileName); FileStream myFile = new FileStream(filePath + "\\" + _DownloadableProductFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); try { if (FileName.Exists) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;attachment; filename=\"" + FileName.Name + "\""); HttpContext.Current.Response.AddHeader("Content-Length", FileName.Length.ToString()); HttpContext.Current.Response.ContentType = "application/octet-stream"; HttpContext.Current.Response.TransmitFile(FileName.FullName); HttpContext.Current.Response.Flush(); } else { throw new Exception("File not found"); } } catch (Exception ex) { HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(ex.Message); } finally { HttpContext.Current.ApplicationInstance.CompleteRequest(); } } } }function resize() { if (grid) { var w = document.documentElement.clientWidth; var h = document.documentElement.clientHeight -100; grid.get_element().style.height = h + "px"; grid.repaint(); }}protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; //Edits the text value of the column "Flow" if (dataItem["Flow"].Text == "1") { dataItem["Flow"].Text = "Outcome"; } if (dataItem["Flow"].Text == "2") { dataItem["Flow"].Text = "Income"; } } }protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; //Edits the text value of the column "Flow" if (dataItem["FlowReplica"].Text == "1") { dataItem["Flow"].Text = "Outcome"; } if (dataItem["FlowReplica"].Text == "2") { dataItem["Flow"].Text = "Income"; } } }if (eval(something).ToString() != ""){ <span style="font-weight: bold;">Something:</span><%# Eval("something") + "%>}| Hello, I have 3 grids nested inside a main grid using the NestedViewTemplate. Everything works fine for binding and displaying the data. The problem is I want to use a CommandItemTemplate in the nested grid to popup another window for inserting new parts. I can make the window pop-up, I just can not get the primary key from the top level grid to go with it. I have tried all kinds of stuff, but I was hoping to do something like the snippet below to include the PlanID as an argument to my javascript function:
I am open to C# code behind to set the onclick attributes or javascript to dig around if necessary to get the PlanID from the parent grid or the nested grid, it exists in both. I have inserted sample markup below if that helps. Thanks! Tom (Sorry for the blue, I should have typed before using the format code block?) <telerik:RadGrid ID="gridJobPlans" runat="server" DataSourceID="objJobPlans" |
||||
| GridLines="None" AllowFilteringByColumn="True" AllowSorting="True" | ||||
| AutoGenerateColumns="False" | ||||
| onupdatecommand="gridJobPlans_UpdateCommand" | ||||
| > | ||||
| <MasterTableView DataKeyNames="ID" | ||||
| DataSourceID="obj1" CommandItemDisplay="TopAndBottom"> | ||||
| <NestedViewTemplate> | ||||
| <asp:Label ID="PlanID" runat="server" Text='<%# Eval("ID") %>' /> | ||||
| <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="1" | ||||
| MultiPageID="MultiPageSelectedJobPlan"> | ||||
| <Tabs> | ||||
| <telerik:RadTab runat="server" Text="Documents" | ||||
| PageViewID="SelectedJobPlanDocs"> | ||||
| </telerik:RadTab> | ||||
| </Tabs> | ||||
| </telerik:RadTabStrip> | ||||
| <telerik:RadMultiPage ID="MultiPageSelectedJobPlan" Runat="server" | ||||
| Width="703px" SelectedIndex="2"> | ||||
| <telerik:RadPageView ID="Parts" runat="server"> | ||||
| <telerik:RadGrid ID="Grid" runat="server" | ||||
| AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" | ||||
| AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" | ||||
| DataSourceID="objSelected2" GridLines="None" AllowAutomaticDeletes="true"> | ||||
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID, PlanID" | ||||
| CommandItemDisplay="TopAndBottom"> | ||||
| <Columns> | ||||
| <telerik:GridBoundColumn DataField="ID" DataType="System.Int64" HeaderText="ID" | ||||
| ReadOnly="True" SortExpression="ID" UniqueName="ID" Display="false"> | ||||
| </telerik:GridBoundColumn> | ||||
| <telerik:GridBoundColumn DataField="PlanID" DataType="System.Int64" | ||||
| HeaderText="PlanID" SortExpression="PlanID" UniqueName="PlanID" Display="true"> | ||||
| </telerik:GridBoundColumn> | ||||
| </Columns> | ||||
| <CommandItemTemplate> | ||||
| <asp:Label ID="lblAddNewPart" Text="Add" runat="server"/> | ||||
| <a href="#" onclick="return ShowAddPartForm('<%# Bind( "PlanID" ) %>');">Add New </a> | ||||
| </CommandItemTemplate> | ||||
| </MasterTableView> | ||||
| </telerik:RadGrid> | ||||
| </telerik:RadPageView> | ||||
| </telerik:RadMultiPage> | ||||
| </NestedViewTemplate> | ||||
| </MasterTableView> | ||||
| </telerik:RadGrid> | ||||