Hi
how to use paging ability for tamplate item(multi column) RadComboBox
i use from radcombobox that have a multi column ,Paging
but i have a problem with paging
Aspx
| <rad:radcombobox |
| id="RadComboBox1" |
| runat="server" |
| Height="190px" |
| Width="420px" |
| EnableLoadOnDemand="True" |
| AllowCustomText="True" |
| ShowMoreResultsBox="True" |
| ItemRequestTimeout="500" |
| MarkFirstMatch="true" |
| DropDownWidth="423px" |
| HighlightTemplatedItems="true" |
| OnItemDataBound="RadComboBox1_ItemDataBound" |
| OnItemsRequested="RadComboBox1_ItemsRequested" |
| > |
| <HeaderTemplate> |
| <table style="width: 415px; text-align: left"> |
| <tr> |
| <td style="width: 125px;"> |
| Product ID |
| </td> |
| <td style="width: 125px;"> |
| Product Name |
| </td> |
| <td style="width: 125px;"> |
| Unit Price |
| </td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table style="width: 415px; text-align: left"> |
| <tr> |
| <td style="width: 125px;"> |
| <%# DataBinder.Eval(Container.DataItem, "ProductID")%> |
| </td> |
| <td style="width: 125px;"> |
| <%# DataBinder.Eval(Container.DataItem, "ProductName")%> |
| </td> |
| <td style="width: 125px;"> |
| <%# DataBinder.Eval(Container.DataItem, "UnitPrice")%> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </rad:radcombobox> |
Cs
| public DataTable GetDataTable(string Query) |
| { |
| SqlDataAdapter DaQuery = new SqlDataAdapter(); |
| DaQuery.SelectCommand = new SqlCommand(Query, ObjCn); |
| DataTable myDataTable = new DataTable(); |
| if (DaQuery.SelectCommand.Connection.State == ConnectionState.Closed) { ObjCn.Open(); } |
| try |
| { |
| DaQuery.Fill(myDataTable); |
| } |
| finally |
| { |
| if (DaQuery.SelectCommand.Connection.State == ConnectionState.Open) { ObjCn.Close(); } |
| } |
| return myDataTable; |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!Page.IsPostBack) |
| { |
| LoadSupervisors(); |
| } |
| } |
| DataView Dv = new DataView(); |
| DataTable Dt = new DataTable(); |
| private void LoadSupervisors() |
| { |
| if (Cache["Dv"] == null) |
| { |
| DataView dv1 = new DataView(this.GetDataTable("SELECT * from Products")); |
| Cache["Dv"] = dv1; |
| } |
| Dv = (DataView)Cache["Dv"]; |
| } |
| protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
| { |
| LoadSupervisors(); |
| RadComboBox1.Items.Clear(); |
| RadComboBox1.DataSource = Dv; |
| RadComboBox1.DataBind(); |
| } |
| protected void RadComboBox1_ItemDataBound(object o, RadComboBoxItemDataBoundEventArgs e) |
| { |
| e.Item.Text = ((DataRowView)e.Item.DataItem)["ProductName"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["ProductID"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["UnitPrice"].ToString(); |
| } |
when i click on a MoreResult button in a end of combobox popup
combo show doublicated data
Thanks
Ali