Hi,
I am getting this strange issue . I have a grid with three columns . The first column is a field name , the next is operator and the last column is condition. Now , i have a button to edit the row . On click of this button , the second column (operator )should turn into a drop down which is happening. Some of the values in the drop down are equals , not equals and includes. Now the initial condition of the row (before click of edit , field = x , oprerator = equals , condtion = y). On click of edit , the second column turns into a dropdown with the current value (which is equals ) selected and the third column turns into a editable user control (here we are using usercontrol - we have done it using the editorcomponent and renderingcomponet of ultracontrolcontainer). Now the problem is , when the screen loads (after the edit click) , the third column which is a usercontrol shows nothing. Only when we click on the cell (of the third column) , it shows the value and when we go out of it (we click the second column cell again) it again becomes blank. How we have used the usercontrol - we have created a user control class say Z with a ultracomboeditor in it . We have created two instances of Z and assigend one each to editorcomponent and rendering component respectively,
Apart from this we have another issue. The usercontrol doesnot fit properly inside the grid column. Please help asap. It would be great if smbdy can include a code example.Thanks
Hi , I took a look at the sample and made some code changes. I have attached the code sample. However now, the problem is , when after changing the value of the last column (from 10000 to 20000), if i click on the second cell (the operator column), the third column value is getting reset to its original value (10000). Instead of suggesting the chnages , it will be really really helpful , if you can make the changes in this uploaded sample and upload it back from ur side. I needed to get this done by now , but somehw not able to close it. So, only asking to change and upload the code.Thanks
Have you looked at any of the UltraControlContainer Samples included with NetAdvantage?
Your sample isn't working, because things are not set up correctly. For one thing, your UserControl needs to interact with the grid using a single property. By default, the UltraControlContainerEditor with use the Value property, or if no such property exists, it falls back to the Text property.
But there is no link between the UltraComboEditor on your UserControl and the Text property of your UserControl. You need to expose a property with a getter and a setter so that the UI get populated. You also need to have your UserControl send notifications when this value changes. You do this by implement the INotifyPropertyChanged interface.
Your EditingControl (the UserControl) does not.
2) The UserControl is sized to the cell. But the UltraComboEditor inside the UserControl is not. You need to dock or anchor the controls inside your UserControl, or handle the Resize event to position the controls within this UserControl how you want them. Right now, it looks like your UltraComboEditor is just docked to the right.
3) This is nothing to do with the UltraControlContainerEditor. It's not editable because the column is not editable. This is because you are setting the CellClickAction to RowSelect and the CellActivation on the column to NoEdit. Your button click is changing the CellClickAction, but not the CellActivation. So you need to do this:
this.grdFilter.DisplayLayout.Bands[0].Columns["Condition"].CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit;this.grdFilter.DisplayLayout.Bands[0].Columns["Condition"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
Hi Uploaded a dummy attchment. In that
1) when the edit button is clicked , i want the thrid cell's usercontrol to show the value 10000 , also when i click on the first cell , the value should not disappear.2) Currently the usercontrol doesnt fit properly indide the column , it hsould fit properly3) The Ultracombo inside the usercontrol should be editable.
Please help.
Hi RC,
Creating a sample ourselves probably won't be very helpful. There are too many factors and variables here like what properties you are using and what your UserControl is doing. There are already samples included with NetAdvantage that work correctly. So whatever is happening here has to be something specific to your application.
If you can provide a small sample solution that demonstrates the problem, I am sure we can tell you what's going on. But without that, the situation is just too complex to make any kind of intelligent guess.
Okay let me restate the requirement so that u can create a sample -1) Create a class named Filter with properties (string field , string operator , string condition)2) Next create a list of the object of this class (List<Filter> listObj ) The object value will be fetched from database . Say , we fetched the value from db and it now has one row (count = 1) and the value of this row is (field = salary , Operator = Eqauls , Condition = 10000). Now this list object is set as a grid's datasource.3) The grid now has three columns in it namely (column 1 = Field , Column 2 = Operator , Column3 = Condition) and has one row with value (field = salary , Operator = Eqauls , Condition = 10000). There is an edit button outside the grid. We click it.4) The second and third column of the selected row becomes editable. 5)The second column now has a ultracomboeditor as its editor component . The values in the ultracomboeditor will be "equals" , and "Includes". Since the vaule of this cell before edit was "equals" , the ultracombo defaults to the value "equals".
5) The third cell (column name - condition with initial value 10000) , has a usercontrol say u1 as its editor component. U1 internally has a ultracomboeditor inside it. The values of this combo will be fetched from db ..ie,,it is not static. Say , values fetched from db are 10000,20000,30000. Since the inital value of the thrid cell was 10000, the combo inside the user control defaults to 10000. Now , the user selects 20000 from this combo and goes out of the grid. The values gets saved in the bound entity .The bound object now has the values (Field = "Salary" , Operator = "Equals" Condtion = "20000")& the entire row returns to its noneditbale normal form
6) if however ,instead of going out from the grid , the user after selecting 20000 from the third cell, chnages the value of the second cell (which is editable with a drop down) to "includes" , the third cell , which is now displaying user control u1 , has to show a different usercontrol say u2 which will internally have a listbox inside it. The items of the list box , just like the combo inside the usercontrol u1 , will be dynamic , ie they will be fetched from db .The value of the listbox defaults to 10000 as it was the original value of the cell. The user can now select other items (multi-select) also from the list box say (20000) and then steps outside the grid. The changes gets saved to the bound list object . The final status of the bound object now (Field = "Salary" , Operator = "Includes" Condtion = "10000,20000")Please help asap