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..Can anyone help...a bit urgent..
Hello RC,
Could you please try to attach if possible a small sample project reproducing the above mentioned issue, I will be happy to take a look at it?
If you like, you could give me specific requirements in order for me to create a sample project for you.
How do you want me to proceed with this?
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.
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 , 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
Sorry forgot to attach the code. Attached it now.
Hi RC,
Is what you want a simple dropdown in the cell? Your scenario and project seem to be complex. If you like a software development, code review or implementation planning I can guide you to our Consulting Services Team. Please take a look at the following page, especially at the bottom:
http://es.infragistics.com/help/support-policies/.
As I mentioned in one of my earlier replies, there are samples of using UltraControlContainerEditor included in NetAdvantage. If you installed the samples when you installed NetAdvantage, they are already on your hard drive. If not, then you can install them the same way you installed NetAdvantage.
In any case, what you are trying to do here is going to be a little tricky. It's very hard for me to offer you any useful advice without a lot more information, like the structure of your "Filter" object.
The grid in the samples you posted here are not using a custom filter object in the grid cell, they are using a List<T>. So is that what you are actually using? Or is it some custom object?
If all you need are two values, a "to" and a "from" that specify a range, then it would seem to make sense for your grid column to contain a custom object with two properties on it. Using a list is very strange, because a list could have 0, 1, or more items in it, and you are depending on their being only 2. A List will also make things difficult for you because it will be more complicated to track changes to the list, whereas a custom object will be easier to track.
In any case, does it matter to you if the objects are persisted? For example, if the user goes into a cell in the grid and changes the "to" field, but leaves the "from" field alone, does it matter if you change the "form" setting in the existing object as opposed to simply creating a new Filter object with the new properties? I ask, because the latter approach will make things easier for you because setting the grid cell's Value to a new object is something the grid can track, whereas changing a property on an object in the the cell is not.
Hi mike/borris ,
Thansk for your reply. In our app , we are create filters that we need to apply on data. Occasionally we need to edit a filter also.Filter data areloaded within the grid. So for example , salary ranges between 10000 and 20000. If i were to edit this filter , i have to provide user with an environment where he can specify the range. So , for this i need two text boxes , one will have the "from"(10000 for ex) value , the other will have the "to" value (20000) for ex. So showing this two boxes inside a grid column is not possible. In that case we need to wrap them in a usercontrol and show the usercontrol inside the grid. Likewise there are various other requirements as well. If it was associated with a simple dropdown , we would not have used usercontrol in the first place. The problem however is, that , since no simple & downloadable demo of looading a usercontrol grid is avialble on the web , we are just not hitting the right patch. It would be helpful , if you can direct me to a downloadable code example (if any) of loading the usercontrol inside the grid. I looked at the code sample page. But , could not relate certain things as it could not be debugged. If i can get a doenloadable sample , it will be really helpful.