Query And Column's Title Of Datagrid Control
Hi, I have two questions: 1) Is there a way that allow me to make the column's title of Datagrid control like "3 mV/m" and "0.5 mV/m"? 2) In my table, all cell values are double (like "0.0", "180.0", "44.4", "78.0", etc...), however, after I use query to retrive these records) and put them into cells of datagrid control, the data changed to "0", "180", "44.4" (which is fine), and "78".., how could I make these data unchanged? Thanks. Firstry
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Datagrid Column Control
I want to remove the column in my datagrid that shows the ID. How do you control which columns are visible?
Formatting The Column For A Datagrid Control
ok..did a search..tried different way..still can't figure it out.
I have a column in my datagrid control for telephone numbers...the underlying database has the telephone numbers without any formatting (example: 8172442556)...I would like to display it as "(817) 244-2556"
..i tried setting the Format in DataGrid properties for the given column as Custom ..and setting the format string as (###) ###-####
doesn't seem to work...help please...
thanks in advance !!
Exported Column Title Not Matching
When a crystal report is exported to excel the column names are not matching the actual columns, is there a way to fix this, sometimes the columns are in the correct items but on some reports they are not and i cant figure what i did on the report that correctly corresponds the tilte and the detail...
Dazed and confused...
Problem With Table Column Name And Title
Hi,
I use word automation to create a report table form a database query. The following is the code"
Dim i as Integer
Dim strLocation as string
strLocation = App.Path & "EFTT.mdb"
set db = OpenDatabase(strLocation)
set rs = db.OpenRecordset(strSQl)
set WordApp = new Word.Application
WordApp.Documents.Add
set doc = WordApp.ActiveDocument
set sel = WordApp.Selection
doc.Tables.Add Range:=sel.Range, NumRows:=rs.RecordCount, NumColumns:=rs.Fields.Count
Do Until rs.EOF
for i = 0 to rs.Fields.Count - 1
sel.TypeText Text:=rs.Fields(i)
sel.MoveRight Unit:=12
next
rs.MoveNext
Loop
WordApp.Visible = true
set WordApp = nothing
I wonder how to add the column name and title for this report. Thanks!
Jianguo Li
MSFlexGrid Change Column Title / Caption
Hope someone can help me, I cannot find the right properties to change the MSFlexGrid Column Caption during run-time.
I have added a new column during runtime, and I want to be able to add a caption to it.
MSFlexGrid1.Cols = MSFlexGrid1.Cols + 1
what property can be used to set the caption?
Thanks.
DataGrid && ADO -- Why More Than One Datagrid Is Populated With One Query???
Hi,
I have an SStabbed GUI with a datagrid on each tab. I also have ONE ADO connection common to all (i.e. on the main form and not on a particular tab). My problem is that when I run a query to populate a datagrid on one tab, the other datagrids on another tab also gets populated with the same results.
The code is as follows:
With Adodc1
.RecordSource = "select * from PalletView where PalletNo=" & txtPalletNo.Text
.Refresh
End With
Set dgdPallet.DataSource = Adodc1
For each different query on a tab, all I do is replace the 'dgdPallet' name with another datagrids name.
Any help would be much appreciated.
Thanks, Ash
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
**** KNOWLEDGE IS LIMITLESS ! ****
**** FOR EVERY KNOWLEDGEABLE, THERE EXISTS A MORE KNOWLEDGEABLE ! ****
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Add Column To Datagrid
Hi everybody; I hope one of you can help me.
I am displaying a table with a datagrid and want to add a column with the values from another table as it's contents.
Both tables have columns titled CODE. The second table has a field called TYPE that corresponds to the CODE (eg. CODE 101 means TYPE Maintenance). What I want to do is put the values of TYPE from the second table into the datagrid displaying the first table I'm not allowed to add a column into the table being displayed by the datagrid.
I'm connecting to the database thru Adodc (DISA for the first table; CODES for the second table)
I found this but when I try to populate the fields from the second Adodc (CODES) it doesn't work. I figure that's because the Datagrid1 is connected to DISA.
Private Sub AddColumn()
Dim c As Column
Set c = DataGrid1.Columns.Add(DataGrid1.Columns.Count)
With c
.Visible = True
.Width = 1000
.Caption = "type"
.DataField = CODES.Recordset.Fields("CODE").Name
'if i use .DataField = DISA.Recordset.Fields("WHATEVER").Name it
'puts the values from 'WHATEVER' into the column "type"
.Alignment = dbgRight
End With
DataGrid1.ReBind
End Sub
Any ideas?? Thanx in advance.
Set DataGrid.Column Value
Hi,
ive got a Problem with my data grid, i have a DataGrid where the Data Source is an DataEnvironment, allright it works, but now i want do add a column to that grid where i calculate fe: Column1 * Column2 but if i want to insert the value in the column with: DG.Columns(3).Value an error apears:
Column not found, |1
what have i to do to do that???
Column In Datagrid
Hi,
I have a datagrid that bind to a table. Some of the columns of the table are not editable. For those columns in the datagrid, I want to gray them out.
The datagrid property does not give enough tools for me to set up.
Please show me how.
Thank you,
Quang
Datagrid Column
On a form I have a datagrid...how do i specify the column width for each seperate column??
Datagrid Column
I don't want my identity column to show up in my datagrid. How do I control which columns I want visible and which ones I don't?
How To Add Column To Datagrid
Anyone know how to manually add a column to a datagrid.
The default value of the grid when you create the object is to only have two columns, I need 13. Thanks
Nightfox02
Datagrid Column Sum
I have a column in datagrid that displays all the prices. I want to sum up all the values from all the rows of that column and display it as a label. How can I sum up the data??
Thanks ... Bhavesh
Add Column To DataGrid
I am new to working with grids and cannot figure out how to add a column.
The grid is a DataGrid ActiveX Contol - Version 6.0. I can look at the
properties and code but cannot see where to add the column.
I appreciate your help.
Kevin
Add A Column In A Datagrid
I would like to know if it is possible to add a column in a datagrid.
I would like to have a column to describe all line in my datagrid.
By the way, is it possible to display a long text in the header on two line but in the same cell.
For example I have the text "this is my new cell"
And I would like that it display like that:
"this is my
new cell"
because I don't want that my columns have a width of 4000
Thanks in advance
How To Add A New Column Into A Datagrid ?
Hi,
I have a datagrid1 on my screen. I have a recordset myRst contains 3 fields (id, name, age). I set myRst as the datasource for my datagrid.
set DataGrid1.datasource = myRst
Then I want to add a new column into this datagrid1, which can show info depend on the value of AGE. for example, if age < 12, show 'KID'; if 13 <= age <= 25, show 'Tenage'....
DataGrid1.Columns.Add (3)
DataGrid1.Columns(3).Width = 350
DataGrid1.Refresh
Now i want to populate this new column using following code:
myRst.movefirst
do while myrst.eof = false
with datagrid1
if .columns(2).value < 12 then
.columns(3).value = "kid"
......
end if
end with
myrst.movenext
loop
When i ran the program, first 3 columns populuated successfully, but last column is empty, and I got following error:
Column not found, /1
What does this mean?
Grace
How To Get The Column Name Of Datagrid
Is there anyone know how to get the number of columns and its corresponding name of datagrid and put it in list box or variable.
Or there's another option except datagrid which get the field name of a table.
Note: I only knew the name of the table but i dont know its field name.
Thank you very much for your reply.
Datagrid Column Sum
I am trying to find a way to sum the values of a column in my datagrid. I have not even found a way to isolate a single cell, row coordinate. Please help.
Datagrid Column Sum
I have a column in datagrid that displays all the prices. I want to sum up all the values from all the rows of that column and display it as a label. How can I sum up the data??
Thanks ... Bhavesh
Datagrid Column Sum
I have a column in datagrid that displays all the prices. I want to sum up all the values from all the rows of that column and display it as a label. How can I sum up the data??
Thanks ... Bhavesh
DataGrid Column Width Value?
In this expression...
DataGrid.Columns.Item(iCol).Width = 1000
What type is '1000'?
Is it a Pixel, char...number.....etc....i cant figure it out......
the reason for this is I have a MSflex grid which has a column width of 20...i would like to know how to convert that number to the equiv in a datagrid..Please any help would be great. Thanks in advance
Datagrid Column Width ????
I have two datagrids that are exactly the same. The only difference is that I am using them on different forms, and one of them has a filter.
My question is this.
On the first datagrid, I could write column widths like this
AppointmentsDataGrid.Columns("time").Width = 40
AppointmentsDataGrid.Columns("patient").Width = 150
AppointmentsDataGrid.Columns("Doctor").Width = 150
AppointmentsDataGrid.Columns("status").Width = 50
and the output was as I expected.
but then, on the second grid, when I write the same thing, the column widths get rediculously small. Is there a way of specifying the units used for the column widths that I have missed?
Jagdip
DataGrid - Format Of One Column
Set grdStock.DataSource = Adodc1
grdStock.Refresh
grdStock.Columns(0).Width = 900
grdStock.Columns(1).Width = 1700
grdStock.Columns(2).Width = 1700
grdStock.Columns(3).Width = 1700
grdStock.Columns(4).Width = 1700
rdStock.Columns(4).DataFormat = FormatCurrency(Price)
So I want to make column(4) with Format Currency. I tried this but does not work. Does anybody have idea how I can make this format in DataGrid?
Thanks,
Ilimax
Datagrid Column Question
I have a datagrid and would like all the cells in the first column to be "RECEIVE".
I've tried
DataGrid1.columns(0).text = "RECEIVE"
AND
DataGrid1.columns(0).value = "RECEIVE"
Neither worked
I was reading something about the DefaultValue property in my vb book that seems would work for my problem but ofcourse it has no examples. I also looked it up on the MSDN and it talks about using a Tag property, which I dont know how to use.
Datagrid Column Widths
I am using a datgrid, and looking for a way to "autosize" the column widths. Is this possible, or do I need to know the lenth of my data in order to set the column width?
Thanks
How To Set Datagrid Column To Uneditable
Hi. I have a form contains a datagrid (with 2 fields/columns: ID, UserName) and two command buttons ("Add", "View All"). When user clicks on "View All" button, the datagrid will display all the user information (ID 1 to 10) with the "ID" column/field is NOT editable. When the user clicks on the "Add" button, a new row (ID = 11) will be APPENDED as the last row in the current datagrid. In this case, user can add or modify this NEW appended Row (which mean ONLY the row with ID =11 is set to editable) while ID =1 to 10 is NOT editable also. I have use the following methods to make the new row(ID = 11) to editable but to no avail.
Any suggestion is truly appreciated.
Code:
'at form load
datagrid.column(0).locked = true
'when user clicks Add button
datagrid.CurrentCellModified = True
datagrid.EditActive = True
Datagrid Column Question???
Hi Guys,
I have a datagrid which has 5 column only and more than 500 rows. Now I want to Update only 4 th column I wrote update sql statement, but after updating the data I want to refresh only updated Row (other row should remain the same ) and cursor should go to next row on 4th column. Can anybody help me with this???
This is very urgent. please help me.........
Thanks in advance,
Ekta
Datagrid Column Sizing
I am trying to size the columns of a datagrid in VB6. I have placed a datagrid on a form and use
set r=new ador.recordset 'create disconected recordset
and
r.fields.append "col name", adVarChar, 500
to append columns.
There are currently 16 columns i use and no matter how i try i cannot get the columns to the size i want, each column needs to be a width that i specify. All columns seem to be of a size that i cannot determin the source of, its not the defCol widths or any value i can see any where else.
Any suggestions would be very much appreciated.
Datagrid Column Header
Hi all,
the text I have in my column header for my datagrid is too wide for the column width I am allowed. I have used vbCrlf to wrap the text but then I cannot see the second line in the column header row. Is there a way of setting the height of the column header row? Or alternatively is there a better solution to my problem? Any help would be greatly appreciated.
DataGrid Column Format
I want to format DataGrid column (type boolean) to display
'OK' for value 'True' and 'WRONG' for value 'False'.
DataSource is set in run-time mode as:
With DataGrid1
Set .DataSource=rst
End With
I can't format column in design-mode because there is no
column numer in Custom dialog for DataGrid1 properties.
Assign A Value To A Column In A Datagrid
This should really be easy.
I have a datagrid bound to a datasource. One of the column in the datagrid is not bound to a column in the datagrid.
I would like to assign a value, or be able to edit that column like so : grdDataGrid.Columns(3).Text = "Please Work"
Please see attached project (install in c: est1n).
Click on command1 to reproduce problem.
How To Add A Combobox For A Column In A Datagrid
Hi there..
How to add a combobox for a column in a datagrid or dbgrid ..for example in the access tables you can have a pull down list/menu..
The way i add a combobox for a datagrid or dbgrid is to add a separate combobox to the form....
if dbgrid/datagrid has column named product id, when the the user clicks on the column the combobox .left and .height and .top is set to the values of the datagrid.
what it does is it positions the combo box on top of the column in the datagrid.. unfortunately this is not a very easy way of doing..and it does not look good..
is there any other way for me to add a combo box to the datagrid.. doesnt the datagrid/dbgrid has a built in sort of combobox..
Thanking you guys in advance for helpig out..
regards pragash..
Column Lock In Datagrid
is there a way to disable columns at run time in a data grid based on a recordset. i need to build a grid where different departement can view all the grid but can only write in some column depending on the departement.
thanks for any advice
I'll be among the best soon, very soon!!!
Datagrid Column Titles
Ok... I have a datagrid that is attached to an ado control... is there a way of changing column titles after I've sent a query to the ado?
Tag/boolean Column In Datagrid
Can someone show me a sleek way to set a tag/boolean column in the datagrid. I want to accomplish the same task a checkbox would have: the user selects certain records (by putting 1 into the Tag column) and then a new table is created from those records chosen.
The way I have it now partially works. This is my code.
'puts the records user selected into new table
ACCESSdb.Execute "SELECT * INTO [Chosen] FROM [Type] Where Tag = '1' "
ACCESSdb.Execute "UPDATE Type SET TAG = '' where Tag <> ''"
'this resets all the Tags back to nothing
With rsFLEETS2
.ActiveConnection = cn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "SELECT * FROM Chosens ORDER BY TYPE ASC"
Print .RecordCount
End With
Set Adodc2.Recordset = rsFLEETS2
This works, IF the user changes the value to 1 and moves off that record. I guess the grid needs that to refresh. If the user changes the Tag to 1 and clicks on Select right away (without moving off the record), it won't return anything.
Does anyone have any idea who I should be doing this?
|