Hi,
If the row is matching a specific condition (datacell value to some constant value) then these row should be selected otherwise not.
Please let me know, how to achieve this?
Thanks,
Ganesh.
Hello Ganesh,
Trausti's response is correct. In the AfterHeaderCheckStateChanged event handler, you will want to loop through the RowsCollection provided by the EventArgs, and select any that match the cell value you are looking for.
You might want to make sure the HeaderCheckBoxSynchronization is set to None to prevent the cell values from changing when the checkbox is clicked.
Let me know if you need further assistance.
Chris
Many Thanks Trausti and Chris.
It worked for me.
Having one more problem
How to enable checkboxes with readonly datarow.
I have tried with allowupdate but it is enabling the data on row editable.
Please let me know any other precise solution for it.
Ganesh
I may be not understanding your question correctly, but I think you want to enable one field while all other are disabled. If this is correct, then you can set the CellActivation on column level:
Private Sub grd_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles grd.InitializeLayout Dim band As UltraWinGrid.UltraGridBand Dim col As UltraWinGrid.UltraGridColumn
band = e.Layout.Bands(0)
For Each col In band.Columns If col.Key = "MyCol" Then col.CellActivation = UltraWinGrid.Activation.AllowEdit Else col.CellActivation = UltraWinGrid.Activation.Disabled End If Next End Sub
If you then want to enable\disable the cell based on a value in the row, then you can do that in InitializeRow:
Private Sub grd_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles grd.InitializeRow If e.Row.Cells("MyCol").Value = "1" Then 'Disable based on a value e.Row.Cells("MyCol").Activation = UltraWinGrid.Activation.Disabled End If End Sub
Trausti
Thanks Trausti, that done the trick to make rows data readonly with enabling checkbox column.
coming back to checkbox stuff.
The header checkbox is not working on first click and also not getting sinchronized with checkboxes in column.
I had refered the below post but still no success.
http://forums.infragistics.com/forums/p/55436/285084.aspx
Can you please advice?
And also how to take off the expand(+) button for those who don't have the child records.
Ganesh,
Take a look at the sample that I've attached and let me know how its behavior meets your needs. I'm sure that we'll need to change it some, but having the same sample to work with will help in describing what functionality needs to change.
As far as the first issue, we'd have to see the issue demonstrated in a sample to determine what is happening.
Hi Chris,
Is that the one "NetAdvantage_WinForms_20091_SR_2094.msp" service release you are talking about?
Even I tried with this but getting some weird errors so I reverted back to base release.
When the header checkbox is checked, you want it to actually select the rows that match some value in another column?
-Yes it should be.
What do you want to happen when the user unchecks the header checkbox? -It should unselect all check boxes. Now what happens when the checkbox in the cell is checked? Does it select that row? Or does it leave the selected rows alone, and simply synchronize the header checkbox to match that of selected rows?
It selects the row and not synchronize the header checkbox. (We have some stuff on Afterrowactivated.)
Problems
1. On first click after data load header checkbox gets selected but the row checkbox doesnot. On 2nd click onward it select/select all rows.
2. If all the rows are selected and then if we deselect any of the selected row checkbox it doesnot gets sinchronized with header checkbox.
Hope you will understand the concern and situation.
Ganesh Jagtap.
Hey Ganesh,
In regards to nothing happening on the first click, you might want to make sure you have the latest service release of NetAdvantage, as NetAdvantage 2009 Volume 1 was the initial release of this feature.
I kept trying to put together a sample for you, but I'm still having some difficulty understanding your desired behavior.
When the header checkbox is checked, you want it to actually select the rows that match some value in another column? What do you want to happen when the user unchecks the header checkbox?
Now what happens when the checkbox in the cell is checked? Does it select that row? Or does it leave the selected rows alone, and simply synchronize the header checkbox to match that of selected rows?
Due to the confusion and urgency, I may have to pass this issue to our developer support team to help provide a better one on one experience. Any sample you can provided to help clarify the situation would be appreciated.
Chris.
We have some urgency so could you please guide us quickly.
Thanks in Advance,
Thanks for your quick response.
And thanks a lot for the expansion quick fix and it worked absolutely as we intended.
Please let me know if you need furthur details.