privatevoid lbConnections_ItemDataBound(object sender, Telerik.WinControls.UI.ItemDataBoundEventArgs e) |
{ |
RadListBoxItem listBoxItem = (RadListBoxItem)e.DataBoundItem; |
// Add button |
RadButtonElement btn = new RadButtonElement(); |
btn.Alignment = ContentAlignment.MiddleRight; |
btn.StretchHorizontally = false; |
btn.StretchVertically = false; |
btn.AutoSize = false; |
btn.Size = new Size(15, 15);; |
btn.Click += new EventHandler(btn_Click); |
listBoxItem.Children.Add(btn); |
} |
private void InitializeTechnology () { |
IList<DropDownIntItem> ddList = ListTechnology(); |
this.TechnologyColumn.DataSource = ddList; |
this.TechnologyColumn.DisplayMember = "Name"; |
this.TechnologyColumn.ValueMember = "ID"; // ERRORS HERE |
} |
// ~~~ // |
public class DropDownIntItem { |
private string _name; |
private int _id; |
public DropDownIntItem(int id, string nam) { |
this._name = nam; |
this._id = id; |
} |
public string Name { |
get { return _name; } |
} |
public int ID { |
get { return _id; } |
} |
} |
this.gridView.MasterGridViewTemplate.GroupByExpressions.Clear(); |
I have a requirement and need to evaluate if RadGridView can support this.
I need to display hierarchical data in the grid. The data can span unto 4 levels. To clarify it further, say I have Manufacturer, Retailer and consumer. Here the consumer can directly purchase from a manufacturer. Or he can consume from a retailer. Also retailer can purchase from the manufacturer. I am interested in showing up the data in a user friendly format. I have tried these 2 options
1. Group by feature and realized that even when the consumer purchases directly from Manufacturer, the data for the consumer is displayed at 3rd level. Since the data is grouped on Manufacturer and then the Retailer. So here the consumer is shown as Manufacturer1-> Retailer (EMPTY)-> Consumer.
2. The other option was showing the data establishing relationship between tables. This served the purpose but the view is unfriendly. The user has to scroll up and down too much to view the data.
Please let me know if there is a possibility with RadGridView to support this requirement. To summarize it, I need to display data hierarch ally where I have Manufacturer, Retailer and Consumer. The Consumer can purchase from both Retailer and Manufacturer. And Retailer can buy only from Manufacturer. So the hierarchy can be
System.Collections.IDictionaryEnumerator iterator = sortedRuleKeys.GetEnumerator(); while (iterator.MoveNext()) { GridViewRowInfo rowInfo = radGridView_RuleKeys.Rows.AddNew(); rowInfo.Cells[0].Value = ((RuleKey)iterator.Value).RuleKeyGuid.ToString(); rowInfo.Cells[1].Value = ((RuleKey)iterator.Value).keyName; rowInfo.Cells[2].Value = ((RuleKey)iterator.Value).keyValue; } ((GridViewLookUpColumn)radGridView_RuleKeys.Columns[1]).AutoCompleteMode = AutoCompleteMode.SuggestAppend; |
((GridViewLookUpColumn)radGridView_RuleKeys.Columns[1]).DropDownStyle = RadDropDownStyle.DropDown; |
DataTable dt = new DataTable(); |
dt.Columns.Add("RuleKey", typeof(string)); |
dt.Rows.Add("Mobile"); |
dt.Rows.Add("Business"); |
dt.Rows.Add("Fax"); |
((GridViewLookUpColumn)radGridView_RuleKeys.Columns[1]).DataSource = dt; |