|
Have you seen the 'Columns' property for DataGridView tool.
How to display a dialog box for a property like that?
I designed a user control with lots of property in it.
I think it will be better for the user to set these properties through a small window like
in datagridview 'Columns' property.
Any idea?
Plz Help.
Aswin. S
|
|
|
|
|
|
i have a gridview and bind it to datasource. gridview has a bounded boolean column. i want if grid to be not editable expect those cells in the boolean column where value is false.
in other words:
all columns are readonly expect the boolean column not readonly.
if the value of the cell in boolean column
1- true: the cell is readonly
2- false: the cell is not readonly
i tried this code but i do not know why it does not work.
For Each x As DataGridViewRow In DataGridView1.Rows
If x.Cells("DeductionAdded").Value.ToString.ToLower = "true" Then
x.Cells("DeductionAdded").ReadOnly = True
End If
Next
|
|
|
|
|
Hi
1) Fetch your data to datatable
2) Bind data table to the datagrid.
3) then, you can use your previous code.
Now it works fine.
Thanks.
Gopal.S
|
|
|
|
|
I'm creating my own custom control as part of a level editor for a video game. The video game is two-dimensional and is composed of square tiles. The basic idea is that the user has a toolbar containing square images, and that when the user clicks on a tile on the map, that tile is filled with the corresponding image. The user also has the option to click and drag to create a selection rectangle, thus allowing a range of tiles to be filled simultaneously.
The initial implementation initially worked well. I was able to create a control showing all the tiles, and allowing individual tiles to be filled. I even got it to the point where dragging the cursor would "highlight" the borders of tiles that were going to be filled. However, I ran into a performance problem when the number of filled tiles increases. The problem is that I was invalidating the form everytime the mouse was moved (to draw the selection rectangle and highlight borders), which caused all of the images to be repainted as well.
I made several modifications to attempt to increase performance. The first choice was to enable double buffering, which reduced flickering and improved performance a little. The second mod was to change the invalidate method so that the control was invalidated only when the selection rectangle selected new cells. This resulted in a less-smooth selection method, but increased performance a little. Realizing that invalidating the entire control was wasteful, I made it so that only the "changed" region was invalidated (the region enclosing both the new and old selection between mouse movements). This helped performance as well, but only minimally.
Since performance was quite good when there were no filled tiles, the obvious problem is redrawing all of the images (imagine a 20 x 20 grid of 48 x 48 pixel images, so rougly 400 individual images). Despite the fact that double buffering was used, I realized that the images never really need to be painted until AFTER the selection rectangle has finished. So, my next mod focused on keeping a cached bitmap of the current viewing area in the back ground, and in the paint method I just combined this cached background with the selection rectangle when the mouse was moved. When the mouse was released (which invokes an action to fill the cells), I would update the corresponding region on the cached bitmap. The problem with this method is that it still caused the tiled images to be painted each time the mouse was moved (even if the tiles were batched rather than individually drawn, although this may be redundant with double buffering enabled).
I then searched for a way to minimize the number of times that I would draw the background. I came up with the idea of having a double-layered control - the bottom layer would contain the bitmap of the images, while the transparent top layer would ONLY display the selection rectangle and the highlighted grid. This seemed to be the perfect solution - on a mouse move, I would only have to invalidate the top layer and repaint a collection of lines while the tiled image background could be left untouched. When the mouse was released, I would only have to update the bottom layer of the control once, and let it show through the transparent top layer. In order to accomplish this, I had to create a [true] transparent control (through the modification of the CreateParams flags, instead of just using the "fake" transparency where the backcolor of the control is set to the backcolor of the owning form). Of course, there was a problem. The problem is that (from what I've seen, correct me if I am wrong) transparent controls simply copy the contents of whatever is beneath them in Z-order onto the control itself, rather than simply not painting "transparent" regions. The result of this is that when drawing the selection rectangle, the region never clears itself and a new selection rectangle is drawn each time the mouse is moved, along with all the previous rectangles. When attempting to clear the top-layer graphics manually, the area "beneath" the control is no longer visible (it clears the copied transparent image).
I've grown quite frustrated with this, and I was hoping someone could suggest something that I haven't thought of. If not, the only solution I can see is moving to a graphics-accelerated implementation using OpenGL or DirectX. Thanks in advance for any help.
|
|
|
|
|
OK, this might sound simple but it's driving me mad!
I have a master table with a foreign key linked to the PK on a child table. I want to bind a list box to the master table value but with the list box populated from the child table values and have this change with the underlying next/prev movements and be updatable (select the textual description and the key value is written back).
Sorry if this is numpty like but I really need to get this done quickly and easily (using the GUI as it's all done with whizzy buttons and drah and drop rather than properly written)
Any help would be great,
Thanks,
Adam.
|
|
|
|
|
Have you figured this out or still working on it?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i was working with VS.NET 2003 and i use some language in my forms and after that i converted my project to .NET 2005.
my problem is:
i started my work with .NET2003
i used some other langauge (Arabic)
then i converted my Project to 2005
then i got an error:
"Error 18 Unable to embed resource file 'C:\Documents and Settings\mdallal\Desktop\New Folder\Al-Ghad\HRProject\HR_UI\obj\Release\WindowsApplication1.termination_type.resources': System Error &H8007000e&"
each time i change the code and build the project i get this error, my solution was to close the VS and re-open it again and build the project. but i wanna to solve this problem not take around
any idea
|
|
|
|
|
Have you figured this out or still working on it?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi how to validate two textbox values. ex, there are two textboxes, password and confirm password.. I want to compare these two. we can use comparevalidator in ASP.net. how can we do in windows forms..? can any one send me code? thanks in advance? am using asp.net 2.0 and C#.. I have used errorProvider control.
see the following code..
if (txtFirstName.Text.Trim().Length == 0) // working fine
{
errorProvider1.SetError(txtFirstName, "This Field Can not be empty.");
}
if (txtUnitID.Text.Trim().Length == 0) //working fine
{
errorProvider1.SetError(txtUnitID, "This Field Can not be empty.");
}
// not working
if (txtPassword.Text.Trim() != txtConfirmPwd.Text.Trim()) // not working.
{
errorProvider1.SetError(txtConfirmPwd, "Password not matched.");
}
I have written this code in save button click event. ex, if pwd is not equal it not showing error message. wat is the problem..?
|
|
|
|
|
i tried it in vb.NET and its work fine my code is:
If TextBox1.Text.Trim = TextBox2.Text.Trim Then
MessageBox.Show("Yep")
Else
MessageBox.Show("Nep")
End If
i dunt know where is the error
|
|
|
|
|
Application Type: Windows Application (.Net 2005)
Development Language: C# .Net
Back End: MySQL
I have a requirement to select multiple rows in DatagridView as I select check boxes in the particular row and do bulk operations on the selected rows.
(The same case as in Shopping Cart grid having item detail columns as well as check box column to remove multiple items at a time in web application). But I can not achieve the same functionality in windows. Can you please help me how to do this?
Regards,
Tarang Pandya.
Software Engineer.
|
|
|
|
|
All,
I am looking to buy a component suite, mainly to get a good data grid. Performance is a must.
It looks like Infragistics and DevExpress are the most popular ones. Any opinions on which one to choose?
Thanks in advance,
Roel
|
|
|
|
|
My honest opinion...stay away from both, especially if all you need is a data grid control.
The Infragistics controls have an excellent visual look to them and are very customizable using themes, but the programming model is awkward at best and not very well documented. DevExpress controls, on the other hand, are a much better programming model and better documented, but have subtle visual problems.
If all you need is a data grid, check out SandGrid[^] from Divelements. I have used several of the Divelements controls and find that they are very easy to program to, have a very clean look, and are pretty well documented.
[Disclaimer: I'm not affiliated with Divelements in any way.]
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
You should really download the evaluation editions and try them out yourself. This is the only way to find out which one best meets your needs.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I keep reading here and there that Infragistics controls, especially the grid, do not perform well. Anybody has any experience with or comments on that?
Roel
|
|
|
|
|
Perform well in what sense? Most of the data grid controls have performance issues as the size of the underlying data increases. To help these problems, they all have some sort of "virtual" mode where only the data that is being displayed is loaded, and each load pulls in smaller "chunks" of the data.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
You should also look at Syncfusion component suite
|
|
|
|
|
Hi all i wanna update my windows applicarion of C#.Net2.0
since VS2005 give Clickonce i've adopted dat to use this, but i am not with the correct outcome, please help me how to update my application.
i have taken a button<named update=""> and whenever user clicks update it should check for the latest version and should be updated
, whenever i run the below code its asking me to check is ur application is running under click once,
my code,
if (ApplicationDeployment.IsNetworkDeployed)
{
// Hold a reference to the current deployment
ApplicationDeployment currentDeploy = ApplicationDeployment.CurrentDeployment;
// Check to see if an update is available on the server
if (currentDeploy.CheckForUpdate())
{
// One is available, go get it
currentDeploy.Update();
// Make sure you save application state here
DialogResult dr = MessageBox.Show(
"Update downloaded, restart application?",
"Application Update", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
Application.Restart();
}
}
}
if (ApplicationDeployment.IsNetworkDeployed)
if i din't use this ApplicationDeployment.IsNetworkDeployed, its giving INVALIDDEPLOYMENTEXCEPTION--Application not installed.
Please help me how to overcome this thing..
Thnx in advance,
prashanth
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
I'm working on a shell replacement for Windows. I only have two big problems left. One is how to create my own system tray implementation. I thought that you could simply create a window of the class "Shell_TrayWnd" and receive icon notifications. I do that, but I never receive the notifications! From the look of other shell replacements, I'm supposed to receive messages in the form of WM_COPYDATA containing notify icon messages (and also appbar messages?). However, I never do! My implementation right now consists of calling RegisterClassEx, then calling CreateWindowEx. RegisterClassEx is given a pointer to the function I'm using as the WndProc. I can receive messages through it, but I never get the system tray ones. Is there something I'm missing?
|
|
|
|
|
hi everybody
can anyone helps me to get how converting a word document to an xml file
regardless
etretyertyery
|
|
|
|
|
Well, Word itself can save the document to XML (WordML). I would guess that this would be your starting point.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hello
the convertion should be done in C# with XML
thanks
etretyertyery
|
|
|
|
|
Yes - but you can use Word via Interop, so you can do this like that.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
can u give me some example with some snapshot
10x.
regards
etretyertyery
|
|
|
|