or
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="BorrowSmartReporting.test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Panel ID="TestArea" runat="server" /> </div> </form> </body> </html>using System; using System.Collections.Generic; using System.Drawing; using System.Data; using System.IO; using System.Linq; using System.Web; using Telerik.Web.UI; using Telerik.Charting; namespace BorrowSmartReporting { public partial class test : System.Web.UI.Page { public System.Drawing.Color[] ChartColors = new System.Drawing.Color[13] { System.Drawing.Color.Black, //Total Liabilities System.Drawing.Color.DarkOrange, //Spent System.Drawing.Color.YellowGreen, //Saved System.Drawing.Color.LightBlue, System.Drawing.Color.BurlyWood, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.Goldenrod, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightSalmon, System.Drawing.Color.Silver, System.Drawing.Color.Thistle, System.Drawing.Color.Gold }; protected void Page_Load(object sender, EventArgs e) { DataTable LiabilityTable = new DataTable(); LiabilityTable.Columns.Add("Balance", System.Type.GetType("System.Double")); LiabilityTable.Columns.Add("LiabilityType", System.Type.GetType("System.String")); DataRow Test1 = LiabilityTable.NewRow(); Test1["Balance"] = 21000; Test1["LiabilityType"] = "Auto"; LiabilityTable.Rows.Add(Test1); DataRow Test2 = LiabilityTable.NewRow(); Test2["Balance"] = 10000; Test2["LiabilityType"] = "Credit Card"; LiabilityTable.Rows.Add(Test2); DataRow Test3 = LiabilityTable.NewRow(); Test3["Balance"] = 210000; Test3["LiabilityType"] = "Mortgage"; LiabilityTable.Rows.Add(Test3); DataView Liabilities = new DataView(LiabilityTable); RadChart CurrentLiabilitiesPageChart2 = new RadChart(); double total = 0; for (int i = 0; i < Liabilities.Count; i++) { ChartSeries stackedBarSeries = new ChartSeries(); stackedBarSeries.Type = ChartSeriesType.StackedBar; double balance = 0; double.TryParse(Liabilities[i]["Balance"].ToString(), out balance); total += balance; stackedBarSeries.AddItem(balance); stackedBarSeries.Name = Liabilities[i]["LiabilityType"].ToString() + " (" + balance.ToString("C0") + ")"; stackedBarSeries.Items[0].Label.TextBlock.Visible = false; stackedBarSeries.Items[0].Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; stackedBarSeries.Items[0].Appearance.FillStyle.MainColor = ChartColors[i + 3]; CurrentLiabilitiesPageChart2.Series.Add(stackedBarSeries); } CurrentLiabilitiesPageChart2.ChartTitle.TextBlock.Text = "Balances"; CurrentLiabilitiesPageChart2.Width = 400; CurrentLiabilitiesPageChart2.Height = 300; CurrentLiabilitiesPageChart2.Appearance.Border.Visible = false; CurrentLiabilitiesPageChart2.PlotArea.Appearance.Border.Visible = false; CurrentLiabilitiesPageChart2.Legend.Appearance.Border.Visible = false; CurrentLiabilitiesPageChart2.PlotArea.XAxis.Appearance.TextAppearance.Visible = false; CurrentLiabilitiesPageChart2.Legend.Appearance.ItemMarkerAppearance.Figure = "Rectange"; CurrentLiabilitiesPageChart2.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; CurrentLiabilitiesPageChart2.PlotArea.Appearance.FillStyle.MainColor = Color.White; CurrentLiabilitiesPageChart2.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = Color.Black; CurrentLiabilitiesPageChart2.PlotArea.YAxis.Appearance.CustomFormat = "C0"; CurrentLiabilitiesPageChart2.Legend.Appearance.Location = Telerik.Charting.Styles.LabelLocation.OutsidePlotArea; CurrentLiabilitiesPageChart2.AutoLayout = true; TestArea.Controls.Add(CurrentLiabilitiesPageChart2); } } } http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid
Now, I'd like to be able to grab the column selected and it's value in the filter and pass that along to a 'button-click' event. I'm having trouble figuring out where and how to get these values. Can anybody help me?
Thanks,
Phil
<telerik:RadButton ID="RadButton1" runat="server" Text="RadButton Submit" EnableEmbeddedSkins="false" Skin="MyCustomSkin"> </telerik:RadButton>
protected void btnEdit_Click(object sender, EventArgs e) { if (RadGrid1.SelectedItems.Count != 0) { //Guid g = new Guid(txtName.Text); txtName.Focus(); pnlExternalForm.Visible = true; RadGrid Grid = (this.FindControl("RadGrid1") as RadGrid); string UID = Convert.ToString(Grid.SelectedValues["UID"]);//this shows no row is selected
string query = "SELECT * FROM Entry where UID=" + UID; GetProductInfoForEdit(query, UID); LoadData(); } } private void GetProductInfoForEdit(string query, string UserID) { DataSet ds = GetInventoryForm(query); txtName.Text = Convert.ToString(ds.Tables[0].Rows[0]["Name"]); txtMailText.Text = Convert.ToString(ds.Tables[0].Rows[0]["Mail Text"]); txtMailSubject.Text = Convert.ToString(ds.Tables[0].Rows[0]["Mail Subject"]); lblUID.Text = UserID; LoadData(); }