Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi freind's,

when UserControl loaded, no load result in gridcontrol devexpress?

C#
private void VasaetNaghliyeSabokVaEsghat_Load(object sender, EventArgs e)
       {
           simpleButton1.Focus();
           LoadGrid();
       }


C#
private void LoadGrid()
       {
           con.connect();
           SqlDataAdapter SDA = new SqlDataAdapter("Utility.EditCar", con.conn);
           SDA.SelectCommand.CommandType = CommandType.StoredProcedure;
           SDA.SelectCommand.Parameters.AddWithValue("@Kind", "1");
           SDA.SelectCommand.Parameters.AddWithValue("@PageNumber", "1");
           SDA.SelectCommand.Parameters.AddWithValue("@RowspPage ", "3");
           DataSet dsRel = new DataSet();
           DataTable dt = new DataTable();
           SDA.Fill(dt);
           if (dt.Rows.Count > 0)
           {
               for (int i = 0; i < dt.Rows.Count; i++)
               {
                   object[] obj = dt.Rows[i].ItemArray;
                   gridView2.AddNewRow();
                   int rowHandle = gridView2.GetRowHandle(gridView2.DataRowCount);
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[0], obj[0].ToString());
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[1], obj[1].ToString());
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[2], obj[2].ToString());
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[3], obj[3].ToString());
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[4], obj[4].ToString());
                   gridView2.SetRowCellValue(rowHandle, gridView2.Columns[5], obj[5].ToString());
                   gridView2.UpdateCurrentRow();
               }
           }
           con.disconnect();
       }


Tanks All
Posted
Comments
BillWoodruff 8-Jan-15 12:11pm    
If you have purchased an expensive software suite, like DevXpress, why aren't you using the support forums there you are entitled to use ?
[no name] 9-Jan-15 3:16am    
i use trial version.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900