Datagrid Inside MdiChildren NOT Applying Custom Format?
May 24, 2012
I have a datagridview (windows forms) that is inside an mdiChild form. The custom format is given by a "for" instance, something like this:
For row As Integer = 0 To .Rows.Count - 1
If .Rows(row).Cells("someNumber").Value = 0 Then
.Rows(row).DefaultCellStyle.BackColor = Color.DarkSeaGreen
End If
Next
So, for every row in the grid that you find, if ther value in the "somenumber" =0 paint the whole row green. Problem is, if I put the form OUTSIDE of the MDIParent - just put frmMyform.show() in my btn that calls the form-, the grid WILL apply the format; If I call it like frmMyform.mdiparent = frmMdi, then frmMyform.show, the grid WILL NOT apply the format.
View 4 Replies
ADVERTISEMENT
Apr 9, 2009
I created a form with a datagrid to show data stored in an Access database. It shows the data correctly, using the code:
[code]...
("compras" is the table name and "Comprasver" is the dataset name).The form also has 3 textboxes and 1 DateTimePicker.Then I created a sql query to allow the user to search within 4 fields of the table (field1, field2 and field4 get the data in the textboxes and field3 gets it in the DateTimePicker). The query looks like this: SELECT field1, field2, field3, field4, field5 FROM compras where field1 like "%"+?+"%" and field2 like "%"+?+"%" and field3 like "%"+?+"%" and field5 like "%"+?+"%" field4 is not an important search criteria, so I didn't include it in the query. Field1 and field2 are both string type. Field3 is a Date type and field4 is integer.Once I made the query, it automatically added a toolstrip with a code, which I cut and pasted in my "Search" button "click" event. The code looks like this:
[code]...
But every time I try to search, no matter which criterias I fill in (even if I fill in none of them), I get an error message saying something like the conversion of the "" string into Integer is not valid (my Visual Studio version is in Spanish, so I don't know how to exactly translate the error message).It's supposed to let the user fill in one, more or all search criterias (all 4 search fields).I found out that if I delete from the query the two fields that don't have String type data, it works correctly. What should I do in order to be able to use the Date and Integer type fields as search criterias too?
View 4 Replies
Feb 15, 2012
I'm adding a textbox to my grid as follows and formating it as a date.But reagrdless it doesn't seem to want to format it as a date.Further how would I prevent, for just a single column, the user from entering anything but numbers and "/"'s?[code]
View 5 Replies
Jun 13, 2012
Our MRP database stores time as a four character string.
0116
0845
1420
[code].....
View 4 Replies
Jun 25, 2009
I came across this great article on creating a custom datagridview column which creates a graph-like effect in the cells of a custom datagridview column:[URL]..Does anyone know how you would edit this to format the number in the cell as a percentage? And does anyone know how you would set this up to take 0 values which do not create any graph effects at all.I have been trying to do this but keep getting errors.
View 1 Replies
Jan 31, 2012
I was trying to block the closing of a custom combo box popup window in my custom DataGrid. The popup window comes by pressing F4 or ALT+DOWN keys in my datagrid which is getting closed if I press the down arrow for the first time, after showing the first value in the combo box as selected. Next time onwards, if I press the F4 key and down arrow, I can move to any item in the popup window and select the item using keyboard and in that case, the popup window is not getting closed till I press the ENTER key or selection using the Mouse. Is there any specific reason for this behaviour or something is missing in my code part? [code]...
View 1 Replies
Sep 2, 2010
I was trying to block the closing of a custom combo box popup window in my custom DataGrid. The popup window comes by pressing F4 or ALT+DOWN keys which is getting closed if I press the down arrow for the first time after showing the first value in the combo box as selected. Next time onwards, if I press the F4 key and down arrow, I can move to any item in the popup window and select the item using keyboard and in that case, the popup window is not getting closed till I press the ENTER key or selection using the Mouse.
View 13 Replies
Jan 8, 2010
The bottom line on a dropped-down datetimepicker shows the date different then in the text-part.In my case, the text-part format was yyyy/mm/dd, but the bottom part of the dropped down part stated Today: dd/mm/yyyy, what is probably the format set in the regional settings.
View 5 Replies
Jan 13, 2010
I want to format the Timespan to have format like this 49 hr 34 mn 20 sec
I used the String format below :
String.Format("{0:00}:{1:00}:{2:00}", theTimeSpan.TotalHours, theTimeSpan.Minutes, theTimeSpan.Seconds)
It formats the Timespan to this format 49:34:20. How can I add hr mn sec to the String.Format above? or there's another easy way?
View 1 Replies
Nov 30, 2009
I am trying to do a custom date format in VB.net using Format. The data coming in is "2009-10-03 00:00:00.000" and I want it to be "OCT 03 2009 12:00AM". I am using Format(object, "MON DD YYYY HH:MIAM") and am getting screwy results ... "2006-09-17 00:00:00.000" becomes "9ON DD YYYY 00:9IA9".
View 2 Replies
Jan 31, 2011
I want to create a custom class that has inside an array of another custom class (see my code below) but when the programm runs is crashes. Why? What is the right expression???? Plz help I'm a newbie in VB.net.....
Public Class ctrarray
Public nameclass As String
Public ctrlindex(glvar_spaces) As ctrlindexclass
End Class
[code]....
View 6 Replies
Apr 19, 2010
I've been working on an application recently and it has exceeded the scope of a single form.I decided that it would be a good time to use an MDI container and split the interface up over a number of different child forms.As the application was written, there were a few different classes that were being instanciated on the original form.I've migrated these over to the MDI parent form so that I can allow all of the children to interact with them.The route that I'm going down right now is raising events on the child forms and watching for them on the MDI parent.The parent form is then doing whatever the child did to the instanciated classes in the past.
View 3 Replies
Feb 22, 2009
I have two MDIParent with one form(MDIChildren). in my mdichildren i have a statustrip with splitbutton, and one of my split button is assign to do an event..how can i do an event with my splitButton in different MDIParent? For example:
I have to open a MDIParent called MDIparent1 (of course it loads of my mdichild automatically)
trying to click a splitbutton will success..but i try to open a another MDIparent called MDIparent2 with my same mdichild and try to click a splitButton will not be success.
[Code]...
View 6 Replies
Jun 22, 2010
is there anybody know how to indicate the checkedbox inside the datagrid is ticked. should i put all the code inside the control something like DataGridView1.CellValueChanged or any other control?
View 3 Replies
Oct 12, 2009
i have custom datagridI want text selected inside datagridcell when user do double click i write so CType(dgrdContenuto.TableStyles(0).GridColumnStyles(1), DataGridTextBoxColumn).TextBox but go in error.
View 1 Replies
Jan 3, 2010
I want to maximize my mdi child automatically by setting WindowState to Maximize. But it looks like this.. why is this happening? but if I restore it and maximize it again its body now occupies the mdiparent space. To aim is not enough. You must hit.
View 2 Replies
Dec 12, 2009
I am trying to enable a timer on multiple MdiChildren and I'm getting an error. What am I doing wrong.
[Code]...
View 7 Replies
Jan 17, 2011
I have put an Input box + Button in my main form to search items inside my DataGridView in Visual Basic 2008 Express Edition, i just dont know what codes to put in my button to enable searching items inside my DataGrid.
View 2 Replies
Jul 22, 2009
I am using a gridview in my form.aspx page. The textboxes in each row of the gridview are to be populated from a datagrid upon clicking a particular field of the datagrid
View 1 Replies
May 30, 2012
I'm working in VB.Net w/ WPF and I need to create a DataGrid at run-time (in the code-behind) with the text in each grid cell able to wrap. I've found a lot of examples showing how to do this in the XML but I can't find anything explaining how this is done in the code-behind. I'm stuck trying to figure out how the DataGridTemplateColumn, CellTemplate, and DataTemplate all work together.
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
[code]....
I think the problem is with the binding and the textblock property. Something like this would make more sense but it doesn't work...
Dim b1 As New Binding("Wrap")
factory1.SetValue(TextBlock.TextWrapping, b1)
View 1 Replies
Feb 4, 2009
I just wanna ask, how to format an image or a picture inside an RTB control? Its like the way MSWORD does the formatting, (i.e Center, Behind Text, etc..).
View 8 Replies
Oct 17, 2010
I have a Visual Basic .Net 2.0 program. I'm moving the settings from an older settings file, to an app.config program settings file. I'm trying to do this as nicely as possible.
So, I added my setting as shown in this image.
On load I do this:
If My.Settings.databaseConnectionSettings Is Nothing Then
My.Settings.databaseConnectionSettings = New ArrayList()
End If
[Code]....
So, the question is, how do I get that arraylist of my DatabaseConnectionSettings saved to persistent storage? I want to do this in the cleanest way possible. That is, I don't want to have to convert it to a string or save it to a separate file every-time I want to use it. I would like to be able to use the My.Settings accessor method.
View 1 Replies
Sep 19, 2011
I have some MdiChildren that have their form titles updated. However, in the MdiParent, the "Windows" Menu does not update their titles when something changes until I change MdiChildren focus.
how to forcibly make the MdiChildren Menu list update?
View 1 Replies
Mar 11, 2011
DateTimePicker Custom format ?
View 2 Replies
Jun 29, 2010
Is there anyway to custom format the DateTimePicker so that users can only select weekdays?
View 4 Replies
Apr 3, 2009
i have datagrid bind to datatime that has one coloumn datetimeI want that user press space bar inside datagrid cell and i want insert current datetimei try so
If e.KeyCode = Keys.Space Then
dgrdVisite.Item(dgrdVisite.CurrentRowIndex, 4) = DBNull.Value
dgrdVisite.Item(dgrdVisite.CurrentRowIndex, 4) = Now.Date.ToShortDateString
[code].....
View 2 Replies
Sep 21, 2010
I have a custom control's library. Now there's a control which looks like a panel, and when it opens up I want to animate its vertical growing like this:
For h As Single = 0 To finalHeight Step 0.5
Me.Height = CInt(h)
' HERE I WANT TO CALL DoEvents'
Next
Me.Height = finalHeight
If I don't call DoEvents in the loop then the animation is not shown, I only get the final height without a visual feedback along the way. I can call DoEvents from inside my main WinForm project, but can't inside a library. How can I do that, without drowning into the deep threads waters?
View 6 Replies
Dec 29, 2010
I'm new to custom server controls and I'm hoping to use them to build various 'modules' for different sites I build to cut down on duplicate code.
I'm familiar with custom user controls in which I can create an .ascx & .ascx.vb file which can then be imported into an .aspx page and used freely.
However, with custom server controls I cannot find a way of using markup/html code. Is this possible at all or must all code be created programmatically?
View 1 Replies
Jun 19, 2010
I'm looking to get the following code converted to working VB.NET code. I need to export data from a datagrid into the CSV format that the user can save off, and the code below from David in Dakota would work great, but it's in C#. This is for a Silverlight 4 site we're working on.
private void exportHistoryButton_Click(object sender, RoutedEventArgs e)
{
string data = ExportDataGrid(true, historyDataGrid);
[Code].....
View 3 Replies
Apr 10, 2009
I am in the process of building an application in Visual Studio 2008/Visual Basic that has a datagrid. One field of the datagrid needs to be formatted as currency and calculate a total for that column. I have the following that is supposed to give the total cost: [Code] I understand the first two lines, since itconnects the DB to the app. The problem I have is that the following lines and how/where I am supposed to handle them. The "DtGrdVwlAlbums.RowCount() - 1" has a line underneath it and is telling me that it is not declared. I do not know what it is supposed to be declared as, and what it connects/relates to.
View 3 Replies