How can I make a column as DropDownList using DropDownProvider in RowEditingTemplate? The sample shows the DropDownList in edit mode within the cell https://es.infragistics.com/samples/aspnet/data-grid/dropdown-editors
Hello,A possible approach to achieve this might be by using the following code that i attach you i think that will helpful to u
if u need more help please visit the below link
http://ahmadkhalid44.blogspot.com/
Regards:
AHMAD Khalid
Software engineer
Saood Software Solution
Thanks for GetValueJavaScript for an ASP:DropDownList. How do you SetValueJavaScript for ASP:DropDownList?
Hi Mike,
This thread was just what I was looking for to be able to put a WebDropDown control in a RowEditingTemplate. Thank you. However, I've noticed a behavior when using the control where the previously selected value remains selected (either highlighted or the background is grayed).
Given In the screen shoot, when I selected the highlighted row, the value of 'Michigan' was replaced with the last value that I selected which is 'Arizona' from the previous row. Also notice that "Albuquerque', 'Arizona', 'Boise' and the row under 'Cascades' are either selected or the background is grayed. They were also selected for rows towards the top of the grid.
Below is the code used in the markup and the codebehind
<ig:RowEditingClientBinding ColumnKey="Territory" ControlID="control_Territory" GetValueJavaScript="$find({ClientID}).get_selectedItem().get_value()" SetValueJavaScript="$find({ClientID}).set_currentValue({value},true)" />
<div class="lbl"> Territory: </div> <ig:WebDropDown ID="control_Territory" DisplayMode="DropDownList" DataSourceID="SqlDataSource2" TextField="mktgrpname" ValueField="mktgrpname" runat="server" Width="250px" EnableDropDownAsChild="true" ClientEvents-Initialize="setZIndex" DropDownOrientation="Default" DropDownItemBinding-TextField="mktgrpname" DropDownItemBinding-ValueField="mktgrpname"> </ig:WebDropDown></div>
Protected Sub GridView_RowSelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.SelectedRowEventArgs) Handles GridView.RowSelectionChanged
Dim DDLB As WebDropDown = _ TryCast(GridView.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("control_Territory"), WebDropDown) If Not IsNothing(DDLB) Then If e.CurrentSelectedRows.Count > 0 Then DDLB.ClearSelection() DDLB.SelectedItemIndex = -1 DDLB.DataBind() DDLB.CurrentValue = e.CurrentSelectedRows.Item(0).Items(14).Value DDLB.SelectedValue = e.CurrentSelectedRows.Item(0).Items(14).Value End If End If
End Sub
What do I need to do to have all previously selected entries deselected (not highlighted and the background white) and highlight the currently selected rows entry highlighted?
Thanks in advance.
Hi mike ,
i have same requirement i.e i have to use infragistc webgrid with dropdown list, and calendar controls
just like in http://samples.infragistics.com/2010.2/WebFeatureBrowser/Default.aspx
1.But i need bind data for grid and dropdowns inside grid from code behind not in markup(aspx), how i have to do.Usualy for asp.net grids we can find controls inside grid in rowbound event and bind data source ,but for infragistice ho wto find controls inside grid, i tried it , i failed , i need sample which will bind data in code behind
2.How to manipulate grid in code behind which willl save all rows at a tiime when user clicks on save
like foreach gridrow in gridview i have to save
3.Add new row,update behaivors are not working if grid has controls like in dropdown ,buttons ,calander in grid (i tried as part of edit behaivor also) , i failed
please do need ful
Regards
showkath
Hello Ram,A simpler way would be to call a function from the DropDownList in the RowEditTemplate after the user selects a new value. The following code demonstrates how to use a DropDownList to call a function in the WebDataGrid RowEditTemplate in place of the WebDropDown:Replace the RowEditingClientBinding for the WebDropDown with the code for the DropDownList as shown here:<ig:RowEditingClientBinding ColumnKey="ShipperID" ControlID="control_Shipper" GetValueJavaScript="getSelectedText({ClientID})" />Add this function to the page: function getSelectedText(clientID) { var dropDown = document.getElementById(clientID); var selectedText = dropDown.item(dropDown.selectedIndex).text; return selectedText; }The above code will return the newly selected value in the DropDownList to the WebDropDown.Please let me know if this information is helpful.Thank you.Sincerely,Mike D.Developer Support EngineerInfragisticswww.infragistics.com/support