I am using 12.5 version recently added new col to table and using it in grid dw. It's displaying on window when I execute app but in saveas excel it's not displaying that col. I tried adding it at last and middle also but no luck. Tried many things but no luck...any guidance.
Changing the SQL behind a datawindow object never updates the dwo. You have to manually add any new column to it. In your case it sounds like you did this but you need to make sure. Also does the column have data? Is the same dwo used to display the data also the basis for the saveas to excel?
Related
I have inserted a dataset to my asp.net webpage, using Add New Item >> Dataset. I have bound it with my table in DB and also previewed data by right clicking Preview Data BUT the problem is previewing data through code.
I am quite familiar with using the datasets in vb.net but I wonder how to use them in asp.net.
I am simply tring to use through filling the TableAdapter, as
Me.TblSQsTableAdapter.Fill(Me.DsSQs.tblSQs, vrExamIDSetPaper)
but dsSQs (my dataset name) does not snow the table name when I press . as we do in vb.net winforms.
I want to get no. of rows that come under given parameter. e.g vrExamIDSetPaper
Plesae help.
Thanks
You need to inspect the Tables collection and then rows.
dsSQs.Tables(0)
dsSQs.Tables(0).Rows.Count
You can do it by using below code by that name vrExamIDSetPaper
dsSQs.Tables(vrExamIDSetPaper).Rows.Count// For how many rows
I have a little appliation that shows MySQL data in web browser ListGrid. It has 14 columns.
I would like to upgrade it so the user could add query parameters.
For this job the best I could imagine is the grid.setShowFilterEditor() that put text boxes above the column headers and will live together with the column header when moved or resized.
I planned to use the filter button FilterEditorSubmitHandler() to get the filter values and run the query.
Unfortunately, I can not find any solution to get the text from a certain filter box eg. the value that was written by the user into the box above Column_#1. Is there any way to do that or this FilterEditor grown together with the DataSources object, and not available for any other data binding?
Something like this, but without using DataSource:
http://www.smartclient.com/smartgwt/showcase/#grid_sortfilter_disable_filter
As per my knowledge, filter editor works on com.smartgwt.client.data.DataSource only.
If you want to have filterEditor in ListGrid, you have to use DataSource or go for some custom implementation.
Using the ASP.NET grid view. It displays 3 columns with 1 row for each, displaying an integer saved in the database. I would like to have a text input one for each column, so the user can add a new row of integers to the database. (The table only displays the last row updated, that part seems to be working OK)
Here is the code I have that displays data but without the input option I would like.
What is the way this is done in ASP.NET (3.5)? Are there more options in the control or do I need to manually bring in text input controls and give each one manual code to update the database? Any help is appreciated.
Thank You.
Do you know the asp.net website? There are a lot of tutorials, e.g. about data access. You might find the information you need, e.g An Overview of Inserting, Updating, and Deleting Data.
Also check out the ASP.NET Dynamic Data section on the same page.
I have a relatively simple Listview that suddenly needs (due to new requirements) to have it's 'layout' extracted to a DataTable so that a common routine can convert it to an Excel spreadsheet for export purposes.
The ItemTemplate is just a series of Table Rows with some text, data-bound labels and textboxes with validators in the cells.
Usually, when trying to pull out a particular value (like what was entered into a text box), I use the ListViewItem's .FindControl method.
For Each objItem As ListViewItem In lvwOptions.Items
Dim objTextHrsLabor As TextBox = CType(objItem.FindControl("txtHrsOptByLabor"), TextBox)
decHours = CDec(objTextHrsLabor.Text)
Next
In this case, however, I'm trying to take all the data displayed - all the 'rows and columns' of the table that was created.
Inside the ForEach / Next loop of ListViewItems, I started a ForEach/Next loop of Controls for each instance's controls but I got some really strange results returned (like controls that had a couple of table cells in them).
I get the sense I'm headed in the wrong direction. All I want is for the nicely-formatted 5-line, 6 column table to be converted to a 5-line, 6-column data table.
Is there another avenue I should be looking at?
I would look at the underlying data source for your ListView.
The data source must be a collection or an IEnumerable and you should be able to iterate through it to build your data table.
If you know that all elements are of the same type then you can use the first element and look at its properties using reflection to determine which columns your table should contain. Then you can add DataRows to your table and fill in the columns using the property names.
This will probably be faster than iterating through the generated html of the ListView.
I used this approach for exporting a ListView to Excel: http://aspalliance.com/771_CodeSnip_Exporting_GridView_to_Excel.
I know it deals with a GridView, but I adapted it to a ListView (as long as the underlying structure is a table) and it worked fine for me.
HTH.
you can use..
listView1.Items[0].SubItems[0].Text
this will be helpful , really simple and easy . You can extract info right on the basis of index & use anyway you want.
How to display the datagrid in insert mode without any data in it.
The GridView is empty and contains only one header.
I want to insert the data in the GridView when the application is running.
What you could do is using an empty Binding Source to a List which would enable you to add new Rows.
Check out some samples of how to use the Binding Source here
Please have a look at these 2 examples:
Insert rows with a GridView
Adding Insert Capabilities to the GridView
I don't think the datagrid will be rendered if its data source is empty. To work around this problem you can give it a data source with only one item that is regarded as empty (for example a data table with one row where all columns have empty values). You can then check for this special case in your program logic.