How to clear selected row, how to choose solid row

rated by 0 users
This post has 4 Replies | 3 Followers

Not Ranked
Points 25
deadbuddha Posted: 06-08-2008 4:04 AM

Hello there, been trying to figure this out for a while and for some reason i cant duplicate the behavior that my normal dataviewgrid had.

would appreciate any help.

 

 

2)How do i make it so it selects a solid row when i click on the grid, right now it selects a whole row, but you can still click on the invidual

cells which throws off the groove. i know they have a cell selector in a little button, but i want to be able to click on any cell and select the whole row.

 

3) Im trying to get the value of the cells in the selected row.

 

Any help would be deeply appreciated,

thanks in advance.

  • | Post Points: 5
Not Ranked
Points 25

 

e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

that sets the row select

which is exactly what i was looking for.

Not sure if this is a bug, but im setting the Row[0].selected and it is deselecting it but the

row is still highlighted.

WOOT! After hours of learning how the grid works, i got the desired effect by doing:

this.dgvMemberItems.Rows[dgvMemberItems.Selected.Rows[0].Index].Selected = false;

 

this.dgvMemberItems.ActiveRow = null;

this.dgvMemberItems.Refresh();

 

Is there an easier way? DataGridView in VS2005 has .ClearFocus(), you guys got anything like that?

  • | Post Points: 20
Top 200 Contributor
Points 851

Hello,

See my code below,

when I implement the same thing what you mentioned, it gives me an error stating that index out of range.

do you know what culd be the problem.

Private Sub ugrdImportDetails_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ugrdImportDetails.InitializeLayout

With ugrdImportDetails

 .Rows(ugrdImportDetails.Selected.Rows(0).Index).Selected = False

 .Refresh()

'End With

 

End Sub

  • | Post Points: 20
Top 10 Contributor
Points 191,383
Infragistics Employee

 InitializeLayout probably fires before the grid has loaded any rows. I would probably do this immediately after you set the DataSource/DataMember of the grid (or call SetDataBinding). 

Mike Saltzman

R&D Engineer

Infragistics, Inc.

  • | Post Points: 5
Top 10 Contributor
Points 191,383
Infragistics Employee

Oh, by the way... if you don't want the active row in the grid to be highlighted, you can reset the grid.DisplayLayout.Override.ActiveCellAppearance and ActiveRowAppearance. 

Mike Saltzman

R&D Engineer

Infragistics, Inc.

  • | Post Points: 5
Page 1 of 1 (5 items) | RSS

Forum Statistics

28,027 users have contributed to 104,793 threads and 116,526 posts.

In the past week, we've had 928 new users, adding to our total of 443,559 registered users!

In the past 24 hours, we have 50 new thread(s), 158 new post(s), and

In the past 3 days, the most popular thread for everyone has been "XamDataPresenter (Mouse Right Click)". The post with the most views is "XamWebDialogWindow dynamic resize". The most replies were made to "XamDataPresenter (Mouse Right Click)".

Please welcome our newest member jsdesfosses.