We stumbled across a requirement where we need multiple radio groups but only one time yes can be selected. But I don't see an option how to group the controls.
So, the data is in a list with multiple actions. I am programmatically creating radio groups with Yes or no options for each action. Requirement here is, if one action is accepted as Yes, remaining groups below cannot be selected as Yes. I want to show a validation in that scenario.
I tried an option with creating textboxes for each group and calculating the value of radio button value. But, docusign doesn't have radio button value in Formula bar.
Is there something I can use for this scenario.
RadioGroup radioGroup = new RadioGroup
{
GroupName = "Accepted",
DocumentId = "1",
Radios = new List<Radio>(),
};
radioGroup.Radios.Add(new Radio { AnchorString = "Action1", PageNumber = "2", Value = "Yes", AnchorXOffset = "282", AnchorYOffset = "-02" });
radioGroup.Radios.Add(new Radio { AnchorString = "Action1", PageNumber = "2", Value = "No", AnchorXOffset = "323", AnchorYOffset = "-02" });
P.s: As it deviates from the UI for user, I cannot use a dropdown/checkbox.
DocuSign doesn't have something that will exactly address this but there are a few options that you could try.
First, you could use conditional tabs and only show the second set of radio groups if the user selects "no" on the first set. That way if they select "yes" in the first radio group, they will be restricted from selecting in the second group.
A second option is that if the user can only select "yes" for one of the radio groups, you could just use one radio group with one radio button placed next to each action where the user is only allowed to choose one action rather than choosing "yes" or "no" for each one.
Related
option selected properly using select class methods, from dropdown but related data of respective option could not fetched.
I use this for search table. select option for search but search action not happen for selected option
how to handle drop down using click
suggest any solution
Select tag can be used to handle the dropdown with tag followed by tags in the page dom, else select class will not work.
IWebElement dropdown_priority = driver.FindElement(By.XPath("Xpath locator")); //build webelemnt of dropdown
dropdown_priority.Click(); //Click on the dropdown so that all the values will popup from the dropdown
//Build collection of dropdown options and pass your desired dropdown value to click on it as below
List<WebElement> myElements = driver.findElements("dropdownvaluesselector");
for(WebElement e : myElements) {
if(e.getText().equalsIgnoreCase("Your_Desire_Value")) {
e.click();
}
I have a Webgrid with a column containing a dropdown:
#Html.DropDownList("abc", new SelectList(Model.holdTypes),#item.holdType,"")
Here Model.holdTypes is a String List. #item.holdType contains the text that needs to be selected.
You are using a wrong overload. You should use this version.
#Html.DropDownList("abc", new SelectList(Model.holdTypes,item.holdType))
While this will render the SELECT element with a selected option, It will generate a SELECT element with only the text, There will not be a value attribute for the option items. So if you are planning to submit the selected option value to a form, This approach might not be very useful. You can use another version for that use case.
#Html.DropDownList("abc",
new SelectList(Model.holdTypes.Select(v=>new SelectListItem { Value = v,
Text = v}),"Value","Text",item.holdType))
I have a form containing a DevExpress LookUpEdit (Windows Forms) which is bound to a list of objects with several displayed properties. The EditValue property is set to another object's property which will receive the selected value.
The user may select any item from the list of objects, but I also want to allow empty selections i.e. the EditValue would become null and the displayed text should be the default [No entry] then.
How could this be accomplished the easiest way?
Currently there's no way to clear the value after it has been set once.
There are two options:
1. User can press Ctrl+Del to clear the value
2. However, this is not intuitive. What I do is add another value to the bound list.
var list = GetOriginalList(); // <- get all possible values
list.Add(new MyItem("[empty]", null)); // <- display name and ID
Try this one :
In form load :
LookUpEditName.Properties.AllowNullInput = true ;
LookUpEditName.Properties.NullText = "No entry";
and use LookUpEditName.EditValue = null; to clear the value
Add Cancel Button to your Lookup Edit and add reset code in Button Click event
Dim editor As LookUpEdit = CType(sender, LookUpEdit)
If editor.Properties.Buttons.IndexOf(e.Button) = 0 Then
YourLookUpEdit.EditValue = DBNull.Value
End If
I have a dropdownlist on a page for which I want to set a text so that whether or not user makes any selection, it should always be displayed to the user and not the selected value.
For example:
Here Select Language should always be visible to user even if I select any value from the list i.e. Option 1 or Option 2.
I guess it is more of a CSS task which I am not very much comfortable with.
If you are talking about a simple asp:DropDownList, you just need to insert an item in it, with an index value of 0 (to deal with server-side checks).
myDropDownList.Items.Insert(0, "Select");
dropdownlist1.Text="SomeText";
Dropdownlist need to have the data-source.
Here Select Language should always be visible to user even if I select
any value from the list i.e. Option 1 or Option 2.
Solution:
if your dropdownlist isn't autopost back enabled then
Maintain a hidden field where on change event of the dropdownlist place the selected value or selected index or selected text there in the hidden field to remember the selection.
lets says the id of your dropdownlist is sel and hidden field is hdSel, the jquery code for that look likes below
$('#sel').change(function(){
var val = $("#sel option:selected").text();
$('#hdSel').val(val);
$("#sel").prop('selectedIndex', 0);
}
);
example on Jsfiddle for your understanding
If your dropdownlist is autopostback enable then you can assign the selected value or selected text or selected index of the dropdownlist to the hidden field and reselect the first item again
Hope this help
In my program, I want to put user-entered data into a category, based on what they selected in the COMBOBOX.
There are four categories, and four DATAGRIDVIEWS that are within a TABCONTROL (on a separate form).
I'm able to add the information a user entered, but the COMBOBOX doesn't have it's functionality yet.
How do I make it so that if the user selects "category 1", it sends the data they entered into dataGridView1, "category 2" to dataGridView2?
I know this will require "if, else-if" statement, but I'm not sure as to how to direct the data based on the COMBOBOX selection to the appropriate DGV.
I would make the ComboBox a required field on the entry form. When the user submits the entry, it should be routed to the proper category. Use the ComboBox.SelectedIndex (or .SelectedText or .SelectedValue) to determine which category was selected. The ComboBox.DropDownStyle should probably be DropDownList so the user has to select from the listed options.
If the categorization happens after the entry, then you should have an Apply or Categorize button that performs the actual categorization. The logic is pretty simple:
private void CategorizeButton_Click(object sender, EventArgs e)
{
switch (CategoryComboBox.SelectedIndex)
{
case 0: // Category 1
// Code to send to Category 1
break;
case 1: // Category 2, repeat as necessary
// Code to send to Category 2
break;
default:
MessageBox.Show("Please select a category!");
CategoryComboBox.Focus();
return;
}
}
This can be refactored and simplified if the code to send to the categories is almost identical. Then you can use the SelectedIndex to identify the target DataGridView instead and reduce the code length and repitition.
Would this be a better or valid way to do it:
if(combobox1.SelectedValue = "category1"){
//user-entered info goes to DGV1
else if(combobox1.SelectedValue = "category2")
//user-entered info goes to DGV2
//.etc.