I have a flex datagrid in a popupwindow.That datagrid should be empty means there is no dataprovider.User will provide data.For that purpose I have to make datagrid columns editable.I tried with editable property.It is not working.And also one more requirment is whenever user completed entering of first row data,next row has to be displayed with empty cells.Can anyone help me.
The datagrid should be displayed with editable empty fields.
You need to set a dataprovider for the datagrid. You need an ArrayCollection that holds all the (newly added) entries from the user plus an empty entry. When you initialize the dataprovider it has to contain the empty entry, otherwise there will not be the possibility to "add" a new entry via the grid because the grid only allows to edit the existing entries. So after the user begins to fill the empty entry, you have to add a new, empty entry to the dataprovider.
Related
I have a grid with ASPxCheckBox in Data Item Template. How to get KeyFieldValue of all rows whose checkbox is checked. I am trying to do this using client-side code and do it for whole grid not on visible index. Is it possible?
Note: I cannot use simple row selection command column as I am using it for some other purpose.
if you dontuse client-side code, you should use detailrow in aspxgridview. And you must use beforeperformdataselect event. if you really need checkbox, you can add checkbox a new field in asapxgridview.
I have a question about a suspicious behaviour in Forms Builder 10.1.2.0.2.
When I have a list object (pop up list) I can define some values in the attribute palette of the object.
So you can set a shown name and a value behind. In this little window to set the items of the popup list you get automatically a white empty item at the end of the list. When I click now on this empty item (you do so, when you want to add an item) Forms Builder automatically adds an new empty item at the end.
When I click this new empty item, Forms Builder adss another empty one ... and so on.
It´s very suspicious because, when I end this dialog with "OK", it will be saved and when I open the form (over web) I have at the end of the list one, two (or more) empty elements in list.
But I can´t delete this empty ones from the list in Forms Builder.
So my question:
how can I delete empty items in a popup list??
I try it with hit "del" button at keyboard or delete the set value for the item (I hope Forms Builder delete items without value). But all does not help.
ctrl+shift+<
or
On my german keyboard it is:
ctrl+< for deleting a line
ctrl+> (= ctrl+shift+<) for adding a new line
When adding the list elements and list values, make sure you only add the ones you need, if you need 3 elements in your list don't click on the 4th box in the property palette, this will add one more list element.
If you have a blank element and you want to remove it, the only way is to click on the property without clicking the "More..." button press on the "Inherit" button on the top of the property palette, this will reset the list elements and list values so you can add only the elements you want.
if you still have extra empty option then make sure of these:
1- make pop list item required
2- if its database item ... make sure you have yes on databse item and column name filled
3- make the column in table to have default value like '1'
hey perhaps you should try this ctrl+shift+,
I have an ASP .net grid view. It has some template columns like a command button, a text box, and a dropdown control. When I click the command button, a new row needs to be inserted below the current row (from where I hit the command button).
If I have rows 1 and 2 and I hit the command button in row1 a new row needs to be inserted between rows 1 and 2
Now in the new row I should be able to select values from dropdown and enter some value in a text box and finally hit my save button. (Which should work fine as I am expecting)
The grid view is bound to some data source say for instance a datatable for now.
Oneway that I could think about is when Command button is clicked, I can add a new row to the datatable in my server side code and rebind the grid. But I am not sure that, from a UI perspective how I can make sure that the new row goes exactly below the row from where I hit the command button.
Any thoughts or comments?
I think a much easier approach will be if you try to add the row in your data source and then bind to the GridView again. This is easy if you have DataSet or a custom entity collection. Since, you are using DataTable this will also work. Handle the click event and find the row that the user clicked. Go back to the dataTable and add an empty row there. This will make sure that the controls inside the GridView are persisted and you don't have to worry about adding DropDown controls etc.
You have to sort the datasource by an virtual index saved in an invisible column. On first databound(perhaps you take a DataView because of ots sorting capability) it will set to the original rowindex. After first hit of the save button you get the datatable again from database and add the additional row with an index after the "selected" row. Then you bind the GridView again with the sorted DataView.
I think you need another invisible column to detect the "temporary" row. If you dont need to edit the "normal" rows then you can use edititemtemplate for this. Otherwise you can make the dropdown and textbox visible and the other controls invisible in GridView.OnRoawDataBound.
There is a code sample that is used for adding a new row in between rows in a grid view.
I am creating an application that will allow users to model configuration information by allowing them to Drag and Drop objects from a Flex Tree into a DataGrid.
I know that both the Tree and DataGrid both support Drag and Drop quite well.
My problem is that I want users to drop items from the Tree into a particular Datagrid cell. I think standard drop events into the Datagrid try to fill the whole datagrid row by default. This is not what I want, I want to drop components into a cell only.
I was thinking that each time an object is dropped onto the datagrid you would have to:
- Get the cell location (x,y) the object was dropped into
- Get all the existing cell objects and rebuild that datagrid row from scratch(dynamically) adding the new dropped object to the row in its correct position. Thus giving the illusion that you can drop into a cell - its a bit of a fudge but I think it could work :)
Any feedback would be great.
Thanks in advance
Mike
Turn drag and drop off for the datagrid.
Write a custom renderer which listens to itself for the DragEnter / DragDrop events. In the handler for the drop event, add the item(s) to the data (at the variable referenced by that column).
If your renderer is bound to the item, it will now update.
((Note that isn't best practice, you'd want to dispatch an event containing the renderer's data item, the variable it was representing and the item(s) dropped, and then manipulate the dataprovider outside of the renderer))
To be more descriptive here's a live example:
http://interklub.biz/CTPonLine.html
In last column there's a ComboBox with some values.
When user choose an option in ComboBox from first row and then scroll down the first choice disapears (comes back to default state).
There's something more strange, earlier I've tried to apply a one more ComboBox in additional column, with highly dynamic values (completly different for different rows), but with after same action (scroll down and then scroll down) values dataProviders from different ComboBox were switch.
It looks like you're not initializing your item renderer properly--when the renderer is reused, it's keeping its old value rather than updating from your data.
You should be able to resolve this by doing one of the following:
binding the item renderer's selectedValue to some property of its data element
overriding set data() to update the control for the current data
acting on the dataChange event and updating there
See Adobe's Working with Item Renderers for more.