in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

couple of questions..

Last post 01-25-2008 9:53 AM by C1_PatrickS. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-24-2008 11:59 AM

    couple of questions..

    I am still evaluating Webgrid (actually the whole suite) for my company.. I have gotten very satisfactory results with web grids so far.. I have a couple of questions and was hoping someone could help me with this..

    1. Is it possible to dynamically change the headertext of a column? I am populating the webgrid with a data table and my autogeneratecolumns is set to true. I have coded the piece where it should be changing the headertext, but it is not changing. I guess it has something to do with auogeneratecolumns.

    2. Is it possible to create grid splits? I have tried looking for some help, but all I could find is information on "fixed" columns. Eventhough fixed column is good, I am not sure if it would allow something like multiple splits (like the one available in truedbgrid).

     Any help would be greatly appreciated!

     

  • 01-24-2008 1:28 PM In reply to

    Re: couple of questions..

    You can refer to the code below to change the header text when the autogeneratecolumns property for the grid is set to true:
     

    protected void Page_Load(object sender, EventArgs e)

    {

    String constr = "data source=local\\sqlexpress;integrated security = SSPI; database=Northwind";

    string select = "SELECT CategoryID,CategoryName FROM Categories";

    SqlConnection conn = new SqlConnection(constr);

    SqlDataAdapter da = new SqlDataAdapter(select, conn);

    DataSet ds = new DataSet();

    da.Fill(ds, "MyTable");

    // Bind the data

    C1WebGrid1.DataSource = ds.Tables["MyTable"];

    C1WebGrid1.DataBind();

    }

    protected void C1WebGrid1_ItemCreated(object sender, C1.Web.C1WebGrid.C1ItemEventArgs e)

    {

    if(e.Item.ItemType==C1.Web.C1WebGrid.C1ListItemType.Header)

    {

    e.Item.Cells[0].Text = "ID";

    }

    }

    For your other query, I would say that if you make any column fixed then all the columns ahead of that column will scroll when you scroll the grid horizontally.

    Regards,

    Patrick

     

    <saketh> wrote in message news:201326@10.0.1.98...

    I am still evaluating Webgrid (actually the whole suite) for my company.. I have gotten very satisfactory results with web grids so far.. I have a couple of questions and was hoping someone could help me with this..

    1. Is it possible to dynamically change the headertext of a column? I am populating the webgrid with a data table and my autogeneratecolumns is set to true. I have coded the piece where it should be changing the headertext, but it is not changing. I guess it has something to do with auogeneratecolumns.

    2. Is it possible to create grid splits? I have tried looking for some help, but all I could find is information on "fixed" columns. Eventhough fixed column is good, I am not sure if it would allow something like multiple splits (like the one available in truedbgrid).

     Any help would be greatly appreciated!

     



    http://helpcentral.componentone.com/cs/forums/p/74110/201326.aspx#201326

  • 01-24-2008 2:07 PM In reply to

    Re: couple of questions..

    Patrick,

    thanks for your quick response. I was able to change the headertext.

    I understand the fixed columns allows all the following columns to scroll, however my question is on multilple splits. Here is what I mean. Lets say a grid has 10 columns. I want the first 3 columns to be scrollable. The next 3 columns to be scrollable in the next split and the last 4 columns to be scrollable in the last split.

    Is this possible?

    Regards,

    Saketh.

  • 01-25-2008 9:53 AM In reply to

    Re: couple of questions..

    I think this does not seems to be possible with the Grid control because whenever you make any column fixed then all the columns before that column gets fixed and you can only scroll the columns after that.
     
    Regards,
    Patrick
    <saketh> wrote in message news:201330@10.0.1.98...

    Patrick,

    thanks for your quick response. I was able to change the headertext.

    I understand the fixed columns allows all the following columns to scroll, however my question is on multilple splits. Here is what I mean. Lets say a grid has 10 columns. I want the first 3 columns to be scrollable. The next 3 columns to be scrollable in the next split and the last 4 columns to be scrollable in the last split.

    Is this possible?

    Regards,

    Saketh.



    http://helpcentral.componentone.com/cs/forums/p/74110/201330.aspx#201330

Page 1 of 1 (4 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.