|
Are you populating the dataGridView from SQL.
|
|
|
|
|
hai bardy,
The datas only displayed from sql.I genarate serial no automatically using above code.It comes in ascending order.but i want to display in descending order.
|
|
|
|
|
Well I'm assuming that you pull the data from Sql into a DataSet then bind it to the GridView.
You can get the Total number of rows from the DataSet (int TotalRows = ds.Rows.Count)
then when you set the serial No just go (TotalRows - e.RowIndex), that should be in Descending order.
Hope this helps.
|
|
|
|
|
|
It's a fairly straight forward bit of C# code and will translate to VB.NET with ease.
Try using one of the online C# to VB.NET converters link this one[^].
Take the time to compare the C# and VB.NET code. You may be suprised how similar they are.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
|
hai all,
i am using dotnet 2005.i doing my project in vb.net windows application.
Is it possible to generate serial number in datagridview.if possible means,i want to generate serial number in datagridview by descending order in windows application,not in web application.
|
|
|
|
|
Sure, you have complete control available to you. However you should make the changes in your datasource not the datagridview. IE when you add a row make the change at the row level.
Beware if you are adding an "identity" value that is not controlled by your datasource (database) you are asking for trouble.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For doing that in the DataAdapter you add a column.Let its name be sno.Then you change the autoincrement property of that column to true.Set auto incrementSeed as a number(For ex: 0) from which number you want to start numbering.Change datatype to System.Int64.
While binding the datagrid with that adapter the column numbers will come..
|
|
|
|
|
Hi
I have two questions regarding WebBrowser Control.
Is there any way to control the class attributes of an html document in WebBrowser control?
And once I have modified some html inside the WebBrowser control's Document then when I am retrieving WebBrowser1.DocumentText property, it is just showing the un-modified version, however, if a get WebBrowser1.Document.body.OuterHTML property then it is displaying all the changes. How can I simply get the complete modified version of that page?
Regards,
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
You can use CSS Class(Cascading Style Sheet) for control it.
|
|
|
|
|
Hi
Thanks for the reply.
Can you also please guide me a little more that where can I find information on this class, I am doing VB.NET windows forms application and using Microsoft's WebBrowser control.
Regards,
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
I have a child form in an MDI application. Before I show the child form I set its location as following:
Dim location as Point = new Point(me.SplitContainerRight.Right + 10, me.SplitContainerRight.Location.Y - 10)
child.Location = location
This does not work the first time the form loads, but works every 2nd try after that. For example, first it does not work, 2nd time it does work, 3rd time it does not work and so on.
I did debug.writeline and it gives me different co-ordinates for child.Location every alternate show.
Any ideas? Code is the same but it only sets location sometimes. Oh yeah, form is On Manual start up.
|
|
|
|
|
I keep coming back to this one, I don't use MDI but the 2 action process brings the event orders to mind. If you use the selectedindexchange on a list control it fires the event 2 times for each row change, 1st to remove the selection and the 2nd to apply the next selection. Could this be the culprit with your forms. What event are you using!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Very good guess. I am using a button click event but events are not the cause. It's the weirdest problem. When I am debugging I have a watch on child.Location and also the new location. I step over and the new location does not get assigned to the child.Location for some odd reason. On the next try it does assign it and then again it doesn't.
I am totally lost!
|
|
|
|
|
I can't seem to duplicate this but I can tell you that you need to set the location of a form after you call the form.show methode (if you do it before it doesn't work (at least not at my end))
|
|
|
|
|
The problem was WindowState should be set to Normal and before I had it sit to Maximized---URRRRRRRGH. Still confused as to why this property will prevent the form from displaying at the correct location.
|
|
|
|
|
Don't ya hate it when it is the simple ones, one of the reasons I like working with a team is that I can bounce the problems at them before resorting to CP (public humiliation);P
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For the last two months I have been fighting an issue with a multithreaded vb.net progran that for no apparent reason goes into a deadlock condition. When the progrm enters this state the only way to break the deadlock is to doubleclick on the main screen and then the screen goes black and a second later the program returns to a normal state and all is well. This typically hapens after about six hours of runtime and the process is in cycle doing measurements and reporting results. Any ideas would be greatly appreciated.
rcombs
|
|
|
|
|
The action of double clicking the main screen obviously changes some state somewhere which causes one of the threads to stop interfering with another.
My suggestion is to follow through on the debugger the event that handles the double click event and see what it changes that releases the deadlock.
|
|
|
|
|
Please I'need help.
how to call my stored procedure in SQL 2000 using VB.NET 2008
with parameter, date range.
thank you
|
|
|
|
|
|
|
|
So? It's the same general idea.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|