|
Hii ,
1) How to create the no of rows ,columns at runtime by entering values of those properties (columns and rows) in propertygrid for datagridview .
2) I dont want to provide the user the facility to enter text in cells .How to disable entering text of all cells at runtime for datagridview ?
3) How can i give name for every column headerCells(which looks solid )at runtime (i.e, User cannot enter text TOP Column )for datagridview ?
4) How can i give name for every Row HeaderCells(which looks solid ) of datagridview without going into default cell while entering text ?
Actually my datagridview has to work like a flexgrid control of vb6.0
dvs
|
|
|
|
|
Hi...
I am sending you a sample code which lets you to add data at runtime... You can put all this code in a test application...
Take a form, Put a button on it and add a DataGridView. Name the DataGridView as dg and past all the following code in the form class
Inherits System.Windows.Forms.Form
Dim tab As New DataTable("MyTable")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim row As DataRow
Dim colIdx, rowIdx As Integer
'Bind
dg.DataSource = tab
For colIdx = 1 To 5
tab.Columns.Add(CType(colIdx, String))
Next
For rowIdx = 1 To 35
row = tab.NewRow()
row("1") = CType(rowIdx, String)
row("2") = "Row two" & rowIdx
tab.Rows.Add(row)
Next
End Sub
Good luck... The code is simple and works
Regards
Nishkarsh
|
|
|
|
|
Hii
Thanks For replying ,
Actually ,I dont need to connect a datatable or something to show data .I have to work in this way .
There is a button on toolstrip .If user clicks it has to create an instance of datagridview it shows with default rows and columns .
Lets Consider 6 cols and 6 rows of DGV .Now ,
1) The cells has to disable without entering any information .
2) Whenever he click on top of Column ,he can write the column name or Row name at that time like this : sampleDatagridView . It has to work like FlexGrid or Excel or think a Calender .All this in design Mode
Emp Det|Jan| Feb| March |Apr |May ............<br />
<br />
ENo |<br />
<br />
Ename |<br />
<br />
Age |<br />
<br />
Salary |
In Edit Mode i can enter the values in cells without changing the column and row names
After
dvs
|
|
|
|
|
Hi
the example i had given also dose not take any data from DB, it creates 5 columns on run time with column headings as 1,2,3.....
Only thing i had done in there is added the columns i a loop....
After that i add some dummy data in 2 columns for each row..
For editable and non-editable part of the issue, you can keep on changing the properties when ever u want during the course of execution
|
|
|
|
|
Hi
I am using a DataGridView control..
Depending on the options selected by the user i have to send some data to a function..
My issue is that i am not able to set the active cell to where ever i want...
If the user clicks a cell then i am able to read data from only that cell..
Regards
Nishkarsh
|
|
|
|
|
Have you resolved your issue?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
|
Cool. I dropped you a line the other day in case you didn't and needed help
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i 28 Users who use a Same Database Application. Well it does not happen all the time, but i have Concurency Problems. Sometimes there will be Concurency Violation.How can i deal with Concurency.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
What database ?
Vuyiswamb wrote: Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
Wow - that sure is depressing.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris
Dont start am not sad
you know what i mean the Table. i need to handle Concurency for 28 users. am thinking of using Threads, but whats you input?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi all,
How would i go about inserting a breakpoint after each 500th character. You see, i have created a flat file using ssis. This packaged reads records from a database and writes it into a flatfile with fixed length. BUT the records do not get written underneath each other... The get written next to each other and this is then a problem when i need to write the final flat file (a combination of three flat files).
The records (read from the database [sql]) gets written like this:
Text Line1Text Line2Text Line3
I want it:
Text Line1<br />
Text Line2<br />
Text Line3
To do this (i think) i need to do something like this...
Read the text line from the datafile into a variable. (this is the text file with the datarecords next to each other)
Take the length of the variable and devide it by 500. (This is because each record / text line is only 500 characters long. This will then be stored in another variable called: Lines )
Then i do a for loop for each line, taking the first 500 characters from the variable and writeln it into the text file. Now delete/remove the first 500 characters from the variable (as to not write them again) and do the same with the next 500 characters until the end of the Lines loop ended.
I dont know if this could be prevented (what i mean is: Can you tell the SSIS Flat File Destination control to write each record into a new line??) if NOT do you think my theory would work using vb.net code?
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Never Mind...
I figured it out.
I inserted a new breakpoint (using writeline) after every 500th character.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi all,
i am facing a problem while i try to make a setup of my project/application built in vb.net 2003.
i am useing setup wizard, when i try to buld solution or build set up the following error message appeaed.
" Error No.1706 valid source could be found for product. VS.net Enterprises Architect 2003-3 English the windows installer can't continue.
kindly anyone help me.
Thanks
rmshah
Sr. Developer
|
|
|
|
|
hi
Am not sure about the Error, but i have googled this, just spend your time on this
http://www.pcperformancetools.com/error1706.htm[^]
Hope it Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi. I would be considered beginner at VB so I hope this question is not bad.
I am working on a genetic algorithm for TSP problem. I will try describe what I am trying to do. I am try to create 10 x 10 matrix has zeros across in cells diagnal from upper left to lower right. For example: in TSP problem distance from point A to A, B to B, C to C, etc will have be zero. I am create random integers from 1 to 100 for other distance. So upper right and lower left must be also symetric. I can create matrix so each cell is random but can not do previous stated problem.
I hope this makes sense.
Any help is many appreciated.
|
|
|
|
|
Have you made any progress in this?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Yes, it was just a matter of entering:
_Array(y, x) = _Array(x, y)
_Array(x, y) = 0
_Array(x, y) = _Array(y, x)
in the middle of my nested for/next loop.
Thank you for the interest though.
|
|
|
|
|
Are you going to do an article here about your TSP project?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi, I have develop any application in vb2005. My application connect to ms. access database. i used textbox to display information and editing in my application. My problem challenge when i try to format the number in currentcy and return the value back to the database when user need to update the value.
In my database there is one field has datatype as currentcy. When its display in the textbox i use the code format(value, "$ #,###.##") to display the value. For example, 6000 display $ 6,000.00 . The problem is when i try to save the value back to the database, the value $ 6,000.00 will cause the problem because $ , and . character is not a valid character.
So, how could i code my application to take only 6000 value from the textbox which contain $ 6,000.00 value? Do i need to use any custom control?
Thank in advance!
|
|
|
|
|
You can change the control to not accept those keys, but if you like the way it displays, just string the string before you insert it, as in
currency = txtCurrency.Text.Replace("$", "").Replace(",", "")
That will replace $ and , with empty strings, giving you the format your DB requires
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you very much for your answer. I will try to solve the problem with the above advice
|
|
|
|
|
Hi all,
recently i migrated vb6 to vb.net and in vb.net i have developed an application using MsSql-7 as backend.
now i want to prepare a setup so i can install all needed file to the target computer.
kindly help me as i am new in vb.net, How can i loaded all needed files in setup.
specialy database
i used setup wizard but can't caryy database files
thanks in advance
rmshah
Sr. Developer
|
|
|
|
|
Your issue is, your user needs to install SQL Server ( which is not free, unless you can use the Express Edition ) and then either attach to an existing blank DB, or run a script to create it. It's not as simple as deploying an MDB file.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
can any1 there help mi on a sms program... i am totally new to this so its rather hard for mi.. what i need to do is a restaurant sms system when user sms to this particular no. den it will reply him via a table no.
|
|
|
|