I have added two new custom field in CMS_USER table.
Both filed is integer type and Form control is Drop-Down list type.
currently both dropdown list is filled by SQL query in Editing control settings.
I want to implement functionality as when user select any value from first dropdown list than second dropdown list will fill according condition of selected value of first dropdown.
second dropdown list will fill on first dropdown selected index changed.
How can I do this.
Path is as Administrator login - >CMSSiteManager-> Administration -> Users -> edit user-> Custom field.
First dropdown is CompanyName and second is CompanyAddress
Any help is appreciated.
The only think that comes into my mind (if you don't want to create custom controls) is that macros are being resolved within SQL queries. So it should be possible to use following
SELECT AddressID, AddressName FROM TableWithAdresses WHERE AddressCompanyID = {% EditedObject.GetValue("CompanyID") %}
as a query for second dropdown list. Use integrated SQL debug (CMS Site Manager -> Administration -> System -> Debug -> SQL debug) to see what is happening.
You can try custom form control.
see http://devnet.kentico.com/docs/5_5r2/devguide/index.html?developing_form_controls.htm
Related
I have a Part Number field displayed as drop down list in my ASP.NET webform.
User will select part number and System will store the respective ID from part table.
Since this is dropdown list, user is not able to type the part number. I want to use a combobox so that user can enter the initial few digits, and then suggestions will pop up like in a dropdown list. Also I want to show error is the entered value by user is not in the database.
I am currently using asp-for and asp-items tag helpers to show data in dropdown.
Is there a way I can get to display combobox instead of dropdown list?
Thanks!
The Answer to above question can be found here:
Link: How to get the values of multiple choose dropdown box
Add the jquery Script from above link. for Select tag, use class as : multiple class="chosen-select" and finally add below script to show default value when input doesn't exist in database.
<script>
$(".chosen-select").chosen({
no_results_text: "Oops, nothing found!"
});
</script>
I have a grid view column called LineNumber i set the autofiltercondition to contains .as you can see here :
But it doesn't work in running as you can see .and i have to enter the whole linenumber to find it .
Should i set something else property ?as you can see i have to enter 1.1/2... to find the line,but i need something like this %my text% in sqlserver
Please go through documentation of AutoFilterCondition Enumeration
Enumerates the comparison operator types for the filter conditions
created for specific columns via the automatic filtering row.
This will work if you have either enabled AutoFilter Row functionality or filter criteria in code.
For the FilterPopupMode Enumeration -
Contains values that specify the filter dropdown style for grid columns.
You have set it to CheckedList, So the filter dropdown is represented as a checked list of filter items. In this mode, an end-user can select more than one item simultaneously. When the dropdown window is closed by clicking the OK button, the View will display those records that contain the checked values
Hope this information help you..
References:
Autofilter Contains
AutoFilter Row problem with LIKE conditions
I have currently implemented a drop-down which displays all the products name from database. On selection of product name from drop down my edit product form will get populated and user can update selected record successfully.
Now my problem is that i have 5000 products in my database.In this case its very difficult for end user to select particular product in drop-down and also populating drop down with large number of records server side takes more time.
What approach should i use to make selection user friendly.Any ideas or help is greatly appreciated
Thanks!!!!
You should use an editable combo box with auto complete feature and load the data depending on user input. Refer this: http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
This way you dont need to worry about the amount of data, it gets filtered as the user inputs some string.
I have a view where a user can enter a bank transaction. So they select an Account, a Payee, a Category (Based on allowable categories for the selected Payee) and a Sub Category (based on the Category selection) - and a value. This is done via JQuery, and is working.
However, there is a requirement to select more than one category/subcategory/amount per transaction (Split the transaction).
I'd like to maybe add a 'grid' (So, a table), and a button under the category/sub category/amount section, labelled 'Add', which then adds the selected Cat/SubCat/Amount to a grid, then blanks the existing selections, ready for more to be added - allowing the user to add as many 'amounts' as needed.
But - how?
On the Add button, I guess I would need to add the CategoryId, SubCategoryId and Amount to a List<>? Then based on that list, build the summary grid?
I'd like there to be no flashing of the screen. Would this have to be done via JQuery? Build the table with JQuery, and then have the list of cats/subcats/amounts sent back to the server on Form submittion?
You might want to look into the jQuery tmpl plugin. This plugins allows you to build client side templates. This is the kind of thing you might want to use on your site.
You define one template of a table row, and each time just add a new row based on that template.
I would give each form item in the table row an extra index variable (such as name="CategoryID-1" for the first row). While inserting a new row, you just send the current index to the template, and make sure the template adds the current index to the names of the form elements.
Then on the server side, you can do a simple query to get all the indeces.
ie
int[] indices = Request.Form.AllKeys.Where(k => k.StartsWith("CategoryID-")).Select(k => Convert.ToInt32(k.Substring(11))).ToArray();
foreach (int index in indices)
{
string cat = Request.Form["CategoryID-" + index.ToString()];
string subcat = Request.Form["SubCategoryID-" + index.ToString()];
//etc.
}
I am using XtraGrid in my application. Now, I want to display only Unique values for particular column when user will click filter button. I want to display this list check box items initially all checked. Also I want the information that what items user has selected/deselected from from checked list box.
Any idea?
I think you need to implement a custom filter dialog, as described here:
http://documentation.devexpress.com/#WindowsForms/CustomDocument698