Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
926
Deselecting first row in the ultrawingrid
posted

Hello,

First Question:

Once I am done databinding the grid, the data is dipslayed in the grid with its first row selected always.
Is there a way where I can remove this behaviour of the grid ? I want to display data without the first row getting selected.

Second question: few text in one of the columns in the grid is too long.And when I try to use ( AutoFitStyle=AutoFitstyle.ResizeAllCoumns) the text is not wraped.Instead it shows half of the text.How can I view the entire text  ?

Please advice.

Thanks

Manjusha

Parents
No Data
Reply
  • 53790
    posted

    Hello Manjusha,

     

    Maybe one possible approach to disable first row to be selected is to handle ultraGrid1_AfterRowActivate() and include the code:

    private bool IsInit;
    private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
    {
      if (!IsInit)
       {
         ultraGrid2.ActiveRow.Activated = false;
         IsInit = true;
       }
    }
     

    Regarding your second question, maybe you are looking for the properties:

    ultraGrid1.DisplayLayout.Bands[0].Columns["B"].CellMultiLine = Infragistics.Win.DefaultableBoolean.True;

    ultraGrid1.DisplayLayout.Bands[0].Columns["B"].PerformAutoResize();

     

    Please let me know if you have any questions

    Regards

Children
No Data