I'm trying to build a custome gridview control. now I've gotten quite far and I am now a bit stuck. I have a property that allows me to specify the columns datatype.
Now when I specify either a datetime or date variable I need to format it properly. Thing is, if I use a database other than sql server how can I format the dates properly. ZI want to make my grid as reusable as possible.
If i use date.tryparseExact I need to know the foemat of the date value being passed in. Problem is, I won't always know the exact format.
I have a question regarding a situation that occurs with GridView, ObjectDataSource in ASP .NET application. The GridView is linked to the ObjectDataSource and both are included within an UpdatePanel letting the GridView to fill in an asynchronous way from a form in the same page so it gets more rows as the user enters the data:
I start the project with Visual Studio 2008, fill the form and it works correctly. Then I stop the execution: rerun again and the data I entered in the previous run is in the GridView. Is like some sort of cache saved the data from the session before. I checked that EnableCaching property is set to false for the ObjectDataSource. If I Rebuild Web Site in Visual Studio (not just Build) then it works corretly leaving the GridView empty. Is this caused just becuase of Visual Studio? Can it be turned off? And will it happen in the final IIS it will run on?
I am trying to develop a very simple templated custom server control that resembles GridView. Basically, I want the control to be added in the .aspx page like this:
[Code]....
I know that what I want to achieve is pointless and that I can use DataGrid to achieve it, but I am giving this very simple example because if I know how to do this I would be able to develop the control that I need.
I'm a new developer here, working in VB. Have a question that is stumping me as well as some others.
I have a gridview control built. I am not using an <sqldatasource> tag, so I can't use it's autoGenerateSelect/Update/Delete functionality. I have built a template field that has an "edit" link button in it, and by clicking it will fire the grdName_SelectedIndexChanged event of the gridview.
Now, it's in this event where I'm having trouble. I have it coded so that when this event fires, it will build a textbox and button control. Code:
Protected Sub grdResults2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdResults2.SelectedIndexChanged
Dim row As GridViewRow = grdResults2.SelectedRow Dim cell As TableCell = row.Cells(6) Dim txtSeq As New TextBox Dim btnUpdate As New Button
'build the textbox in the Search_Seq cell txtSeq.ID = "txtSeq" txtSeq.Width = Unit.Pixel(20) txtSeq.Text = row.Cells(6).Text cell.Controls.Add(txtSeq) 'build the "update" button in the Search_Seq cell btnUpdate.ID = "btnUpdate" btnUpdate.Text = "Update" cell.Controls.Add(btnUpdate)
End Sub
So the textbox and button populate perfectly. I can run it in the browser and it works fine.
How do I go about setting up the event for this button now? Because it's being manually built here in the gridview event, there is no button for me to "double_click" on in the design view to auto-build this event. There are some properties that need to be set on this button to link it up to a new event....and that's where I'm lost.
Hopefully I don't leave any additional information out.
I am trying to build a master detail functionality. It present, there is a web page i.e. page1.aspx with search functionality. When the criteria is entered then the search button can be clicked and then the GridView gets populated with data. In this GridView, a number of the fields of the selected row can be edited as per business requirement. Now I would like the user to be able to see and edit more fields related to the selected row in the gridview. These are extra fields which are not viewable in the gridview. Question: Is it best to have another page i.e. page2.aspx to see and edit these extra fields or is it better to have these extra fields (One in each control) just below the gridview in page1.aspx?
I found the tutorial below to build a chat application for asp.net which fulfilled most of my requirements, i.e. written in vb and made use of database, however the second part is missing. [URL]
I was hoping someone may be able to point me in the direction the original author intended to extend this to cover multi rooms and hopefully multi users?
I want to show the data either in Chart control or Gridview control. When the user selects an option to see the data either in chart control or grid view control, that specific control has to show up and other control has to become invisible.
So far, I am able to populate data successfully in the chart control. If the user chooses "Grid view" option, how can I show the data in grid view control in the same location. I don't want the gridview control to be shown in a pop up window or any other window.
When working with an ASP.Net application, when I rebuild the solution, I would like it to automatically refresh the current version thats running through the integrated server in the browser.
I have looked through post build commands and afterbuild targeting but I have not been successful so far. I would like to do this straight through VS2008 if possible without needing to install anything extra, put if thats not possible then any solution would do!
So here is the problem, when I build my web application in Win 7 x64 and publish (copy) to 2008 Server R2 (also 64 bit), the application won't run when I navigate to a page that uses a 32 bit dll.
When I boot to the Vista x86 partition and build and publish (copy), same code, minimally modified sln file to redirect to same code location. I've created a new entry usiong Menu > Build > Configuration Manager and created a x86 entry. I thought that was all I needed to do to force VS to build to a 32 bit machine. Am I missing something or do I just need to boot Vista when I want to work on my web site?
I'm creating a custom gridview control. so far I've been able to add custom sort arrows and an export to excel feature.
Now I want to have a textbox and a button in the header row to filter each row.
I want to extend either the boundfield or boundcolumn class to add a property that will allow me to distinguish wheter the column should have a filter textbox in the header.
I have a Gridview Custom Control (class library project). What I want to do is, add a button to the page. Once the button is clicked, I need a ModalPopupEctender to come up with a checkboxlist of all the Columns in the SQLDataSource that populates the Gridview.
Now since this is a class library project that inherits from the Gridview, I'm not sure how I can add a div at the very top of the page, with the "Choose Columns" button.
Should I create a user control that contains my Custom Gridview? Reason I want to do what I ask is because I want to reuse this in as many projects as I can, I wan this functionality built in to my dll.
I know that when you hide a control is asp.net that you cannot access it. Is there a way of hiding it as far as a panel? Can I put it in a panel but size the panel to 1x1? Or in a div and hide it?
I have a simple gridview control on .aspx page. It has one combo box in the gridview control and rest of the columns in the gridview control are all bound controls.
When the user picks something from combo box, I should multiply the number (picked from the combo box) with other number in the same row (meaning in a different column on the same row). I want to do all this in server controls not thru JQuery or Javascript.
Basically my problem is I am able to read data from unbound combo box control in the grid. But I should be able to read the contents of another bound column in the same row and perform multiplication between those two fields.
I just want to know if it's possibile to set a NumericUpDownExtender [URL] in particular the forth example, the one with the blue arrows!) at RowEditing of my Gridview when some column are converted in textbox.
If I can't, I want to ask you if it's possible to link a RegularExpressionValidator to the textbox in the row.
I've been working on this error all day! I have a dataview created from a sqldatasource control and I'm trying to assign it to a gridview but I get Object reference not set to an instance of an object. Code: Try Session("dsCustomer") = "Y" [code]......
Can't I assign a dataview as a datasource? Or not?
I have a checkbox template field in a grid view control. I want to execute some code when a checkbox is checked or unchecked - how do I do this? Which event is fired?
I have a simple Gridview control on .aspx page. All I am doing is selecting 3 or 4 fields from oracle database.When I have to_char() function it says "portfolio_rundate" is a not a valid field in the datasource. Wherease the same SQL perfectly works fine in oracle.
I have a gridview control on .aspx page. Situation is, the columns in the gridview control are not databound. I query the database and load the gridview control using the following code.
The gridview control shows about 13 columns from the database. But we want the user to be able to edit only one column. Rest of the 12 columsn should be read only. When the clicks one Edit button button, as usual the Update and Cancel buttons should come up. It is not happening. Only the _Rowediting event is getting trigged. Following is the code from my .aspx page. I don't know anything about template columns and not sure if I have to use that concept in my situation.
I have a gridview control on a .aspx page. It is a bound control. So basically I didn't have to write any code to pull the data from database and show it on the grid.
So far so good. But where is no data is not returned from the database, I want to display something on the page saying "No data returned". But I don't know which gridview control event gets fired so that I can write some code in it to check if the records returned are zero.