|
hi,
This question is regards to code optimization.I have near to 100-150 labels and same number of textboxes in a my main form.And this form also contain few other controls. Say panel, combo box etc.
The data fetching is also dynamic based on users requirement. I check the maximum time with possible chances for data request(range).Performance is good. So i am not worried about data fetching.
My problems is with this much controls and their dynamic sub instances.I found my application becoming too very slow when this much control are drawn in the main form(I mean when form is loaded on the first time).I already told that, the above mentioned number of control is only an example. Some time it may decrease or increase. If i go for some optimization here in my design part then it won't serve users purpose. Clearly i am into trouble. What i can optimise is my code not design.
Is there any way to hadle this situation.
Sreejith Nair
|
|
|
|
|
sreejith ss nair wrote:
I have near to 100-150 labels and same number of textboxes in a my main form.And this form also contain few other controls. Say panel, combo box etc.
That sounds like a very cluttered form. It sounds to me like you should be thinking of redesigning that so that there are less controls, by moving some to subordinate forms of some kind.
sreejith ss nair wrote:
If i go for some optimization here in my design part then it won't serve users purpose. Clearly i am into trouble. What i can optimise is my code not design.
You should think very carefully about your user interface, because, even if you do improve the speed, your form, with that many controls, is likely to overwhelm your users.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
All these controls are very urgent for me. Say these controls are small in size and they are used to show different date of year. So user want to see all date values at a time. So i can't go for control customization
Sreejith Nair
|
|
|
|
|
If its just labels and text boxes, maybe you could use a grid control to display the information.
|
|
|
|
|
All these controls are very urgent for me. Say these controls are small in size and they are used to show different date of year. So user want to see all date values at a time. So i can't go for control customization
Sreejith Nair
|
|
|
|
|
1. Even if the controls are important you can create a wizard sort of User Interface by logically breaking up controls on several screens.
2. You can either create controls at runtime at some instance and then creating adding controls to your form dynamically. This will speed up your form initialization because you are not creating all 100-150 controls at form load.
hope it helps....
best regards,
Hatim Ali.
|
|
|
|
|
hi,
Defanitly it won't help me. My interface, that is the interface that i am going to show is the final out for the user. I can't make any sort of updation or customiztion in my controls list or my interface. This is the way it is working.
I have a small doubt to ask you.
Suppose if you want to show few date values for two months. What you will do ?. Here you need to know one more thing that, you need to show all date value at a time.
anyhow thanks for sharing my this problem
Sreejith Nair
|
|
|
|
|
You have a choice. Either redesign your interface so it is more organized, even if it means duplicating information on sub-forms, or leave it as is. There's nothing else you can do about this. You simply have way too many controls on a single form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
im trying to use the image.saveadd function to save a group of gif images in a single file, the problem is that this function has Encoderparameters parameter and i dont know how to use it, does anybody know how to use the saveadd function or anything about the encoderparameter class?
huda
|
|
|
|
|
Hello,
how is it possible to rename an XmlNode in a DOM implementation like XmlDocument or XPathDocument?
XmlNode node;
node.Name = "abcdef";
This would be very simple but the Name property is Read-Only...
thanks
pete
|
|
|
|
|
It's not allowed to change a node's name, although I'm not to sure why..... You can only add a new Node with, for example the old node's content and with the desired name, after which you delete the old node.
i.e.
<br />
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();<br />
doc.LoadXml("<Test><Testing>content</Testing><Test>");<br />
<br />
System.Xml.XmlNode oldNode = doc.SelectSingleNode("/Test/Testing");<br />
<br />
System.Xml.XmlNode newNode = doc.CreateElement("NewTest");<br />
newNode.InnerXml = oldNode.InnerXml;<br />
oldNode.ParentNode.AppendChild(newNode);<br />
doc.RemoveChild(oldNode);<br />
|
|
|
|
|
//I came across this trick by accident. works like a charm and ridiculously simple.
XmlDocument myXml;
myXml.Load(myXmlNode); //Not sure if this will work, but you get the idea
myXml.InnerXml = myXml.InnerXml.Replace("<OldName", "<NewName").Replace("</OldName>", "</NewName>");
//or if you know name is unique in the node
myXml.InnerXml = myXml.InnerXml.Replace("OldName", "NewName");
"I have found the paradox that if I code until it hurts, then there is no hurt, but only more code". Mother Teresa (if she were a coder)
|
|
|
|
|
hi,
I need a global store for storing error messages. It could be done using singleton.
Now whats the difference between the following two.
1. Implement singleton pattern.
2. Creat a class. Make its contructor private. Expose the functionality using static functions.
In singleton pattern a single object is created but in 2nd approach no object is created. Which approach is better ??
Thanks...
|
|
|
|
|
If there is no explicit need for an object instance, I find the use of all static members simpler. If you want to use it to persist data using the framework's builtin serialization, then you would need an object.
|
|
|
|
|
how do you use system.xml to read and write xml files directly....not by loading them into a dataset.....
|
|
|
|
|
You can either use XmlDocument Class or XmlTextReader / XmlTextWriter Classes for reading/writing XML other than dataset.
hope it helps
|
|
|
|
|
|
i was wondering if anyone could tell me how to create and use dll's in .net
|
|
|
|
|
class library is what you are asking...
|
|
|
|
|
The concepts and terminology has changed with .NET. We no longer have to fiddle with a DLL/EXE/COM Components etc. Read about the concept of ‘assembly’
If you are using MS Visual Studio .NET 2003, create a new project of type ‘Class Library’ Thats your DLL. In the project create you classes and methods. All these will be accessible to the consumer of the DLL. (The consumer has to ‘Add reference’ of the created DLL in his/her project to consume your classes)
|
|
|
|
|
Does anyone know how to [easily] obtain the color of a GroupBox caption when themes are active? (A .NET 2.0 specific solution is acceptable.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I wrote some code to show data from access using datagrid. However, when I try to update or delete data, it always report error that Dynamic SQL generation for the UpdateCommand or DeleteCommand is not supported against a SelectCommand that does not return any key column information. However, when i add data, it is fine.
private OleDbDataAdapter adapter;
private DataSet ds;
private DataTable table;
private DataForm form;
private TextBox[] txtBox;
private OleDbCommandBuilder builder ;
try
{
adapter = new OleDbDataAdapter("select * from CMA",
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=datainfo.mdb");
builder = new OleDbCommandBuilder(adapter);
ds = new DataSet();
adapter.Fill(ds);
dataGrid1.DataSource = ds;
table = ds.Tables[0];
dataGrid1.SetDataBinding(table, "");
this.dataGrid1.CaptionText = "Table: CMA";
}
catch(OleDbException ex)
{
MessageBox.Show(ex.Message);
}
private void OnDeleteData(Object sender, EventArgs e)
{
for(int i=0;i
|
|
|
|
|
The error says it all: it's unable to generate a SQL expression for UpdateCommand and DeleteCommand because your SelectCommand doesn't include key data. Running UPDATE and DELETE expressions requires either 1) your primary key, or 2) some other data that only you could determine to be unique. A primary key is always unique, so the SQL builder requires key data. Of course it isn't needed for InsertCommand because you're adding data; your key may be an identity column that is automatically filled so the SQL builder doesn't care.
There are two options: select your primary key column(s) for your SelectCommand , or don't use the SQL builder and define the commands yourself.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
|
I am spent all day that I am trying to rid the box look like ... on propertygrid from keep from activate editor collection. I tried to look internet and no luck. I tried to use
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;
}
but it wont trigger. please help me about this situation. please show me with example source if neccessary. ThankS!!
|
|
|
|