my scenario is, if user put focus on text in WebDropDown, then text should be highlighted and when he click on Backspace button on keyboard, then text value should disappear.
i am working in .NET and i want to implement this functionaliy in Javascript or JQuery.
How to do it ??
Hi snohig_07,
In order to highlight the text in the WebDropDown's input, you can handle the Focus client-side event and use the following javascript code:
function WebDropDown1_Focus(sender, eventArgs) { sender._elements["Input"].selectionStart = 0; sender._elements["Input"].selectionEnd = sender._elements["Input"].value.length;}
You can find more information regarding the WebDropDown in our documentation at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=Web_WebDropDown.html
Please feel free to contact me if you have any questions.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Hi Petar,
i tried but its not happening. Please find the code below
----JS code----
<script type="text/javascript">
function wddFocus_Focus(sender, eventArgs)
{
sender._elements["Input"].selectionStart = 0;
sender._elements["Input"].selectionEnd = sender._elements["Input"].value.length;
}
</script>
----.ASPX code----
<igWebDropDown:WebDropDown ID="wddFocus" runat="server"
Width="200px"
TextField="FirstName" ValueField="Id">
<ClientEvents Focus="wddFocus_Focus" />
<DropDownItemBinding TextField="FirstName" ValueField="FirstName" />
</igWebDropDown:WebDropDown>
----C# code----
DataSet SongDS = new DataSet();
protected void Page_Load(object sender, EventArgs e)
DataTable songTable = SongDS.Tables.Add();
//-- Add columns to the data table
songTable.Columns.Add("FirstName", typeof(string));
//-- Add rows to the data table
songTable.Rows.Add("Diary of Jane");
songTable.Rows.Add("Pain");
songTable.Rows.Add("Fake It");
songTable.Rows.Add("Paralyzer");
songTable.Rows.Add("Citizen Soldier");
this.wddFocus.DataSource = SongDS;
this.wddFocus.DataBind();
yes, i am still facing same problem.
Please provide me with your product version so I can continue my research on the matter.
i downloaded from this Software --> NetAdvantage_ASPNET_20092.exe
i am telling you names of few dll's out of lot of dll's, which i can see after installation
Infragistics2.Web.v9.2.dll
Infragistics2.WebUI.Documents.v9.2.dll
Infragistics2.WebUI.UltraWebCalcManager.v9.2.dll
Please let me know, if you want any other info.
I tested the code from my previous post in conjunction with the WebDropDown configuration you have provided using version 9.2 builds 1013 and 2187 and am still unable to see any issues. Can you please provide me with information on the specific build you are using.
Just to be sure that I have not misunderstood your requirement: the WebDropDown's input text has to be highlighted every time the WebDropDown comes on focus or when the user clicks on the input field.
I am attaching my modified sample which uses your setup for the dropdown. Please let me know if there are any additional details.
Please do not hesitate to contact me if you need further assistance with this matter.