I am having an object of DataTable which is created by reading some short of files in Controller.
I want to show a dynamic table (data depends, data present in files or not or it may a have column or not) In View using j-query action call after a dropdown selection changed.
also I want a specific column to be in editable mode so I can edit the value and same should be reflected in file after update .
Please suggest me the approach , I have done with data fetch but unable to show in UI and Unable to Edit it ,
Create a partial view with a model containing two lists
ITable
{
IList<IColumn> Columns;
IList<IRow> Rows
}
Create view for this model, either use loop or display template to render the values of table.
Edit Row
With each row provide a hyper-link to edit/delete the row, and let scaffolding create action/view for edit page by using model IRow.
Edit Column
Create a partial view containing textbox and saving functionality(button etc.), with the column identifier (figure it out yourself), and onclick display this partial view over the label.
And on click of save button post server with the value and ID to your action, hide the partial view contents from page, update label or refresh the page. (handle errors as per your project)
Related
I am binding my data using Datatables. I have edit and delete button on every row. Clicking edit will navigate to edit view.
After saving the data in edit view, it is navigated to index view to the first page of the DataTable.
I want it to navigate to the updated row or atleast to the page where the updated row is in rather than going to the first page.
Please help me with this.
test with stateSave property of datatable
$('#example').dataTable( {
stateSave: true
} );
How to get all record data from master data to another grid without change anything from master data and save it into new grid like this picture
into this grid
In the header, I have routingID and I want to get my operationMaster into my new grid in picture 2, any suggestion... I try with PXSelectJoin but it just gets data in master routing, and if I delete the line in picture 2 in my master will be deleted too. i want to get data just in screen to save it in into picture 2
Any Suggestion...
create a db table that will contain data from grid2, corrsponding DAC (dac2) and graph (graph2).
Then you can use an graph2 action to import data from grid1 to grid2. In the action you read data from grid1 using PXSelect ..., and insert it into corresponfing data view of graph2 which contains DAC2 records.
I need to use a form multiple times so i created a user control ( Lets Call It UC1) which i Dragged and dropped a table from data sources window so visual studio automatically creates the required binding source ad link it to data grid . Every time i create a new UC1 object , it automatically creates the data grid View but the binding source isn't linked to it so its just an empty data grid view ( The Column names are there but the data grid doesn't show any records) . How Can i fix this ?
I have tried adding the binding Source with code but didn't change the result
I think it would be easier for you to understand my problem if I explain the scenario a bit.
What I am doing is developing a system to a doctor using asp.net c#. For the creation of the prescription, I add a check box list for the list of medicines and submit button below it. When the submit button clicked selected check box list items added to the sql server database and show a data grid with the selected medicines in the same page.
In the data grid there are two columns for medicine name and dosage.Medicine name is taken from the database.I need to give the user the ability to enter the dosage through that grid view. I need to use update command because the record is already there in the sql server.But empty value in the dosage column.I tried to use update command in the data source control. But I can't figure out how to give the WHERE clause because I can't specify the database row which the updating record relate to.
I would be glad to hear some help from you. All the comments are welcome.
You need to set a parameter(s), please check this example to understand how it works. I guess, that you've added in the database some column that is unique identifier.. some autoincrement int or guid.
I have a grid view that, on selected index, will populate a details view. If the selected index happens to have multiple IP Address's I want to add additional fields to display them. They don't need to be databound since I know the data. I'm using the code below to create the additional template fields. This is done in the Data Binding event.
This works until I select a different row in the grid view, then no data is displayed in the details view. My theory is that it's trying to bind the data but there are a different amount of values returned from the database than controls to put them in. I guess is there an easier way to do this?
// Check for multiple IP
countIP = devicesDetails_CountIP(devicesDataKey);
if (countIP > 1)
{
TemplateField IPAddress2 = new TemplateField();
devicesDetailsView.Fields.Insert(0, IPAddress2);
}
Recently I came across this question, so here is a link that may be of help for future visitors
Create DetailsView from codebehind