|
Hi all
I am using Microsoft FlexGrid (Com Component) in a desktop application(.Net). Using Globalization i am displaying Chinese characters. It is displaying in the labels and messages. But when i am trying to display in the MS FlexGrid it is showing "????" Qestion marks. Can any one help me how will I display Chinese characters in Microsoft Flex Grid.
Thank you
arun
Arun Kumar Sabat
Bangalore
India
|
|
|
|
|
Hi,
How do i know whether the files that are added to the project
are added by File reference or project reference ??
Any help will be great.
Saleem
|
|
|
|
|
There's no way to no just from looking for sure. If the file path (in the PropertyGrid) of a reference references a file in the obj\Debug or obj\Release directory, than it's probably a Project reference. If you switch configurations and the reference is still set to obj\Debug or obj\Release (which it was before), then it's very likely it's a File reference. If the path is somewhere outside a Visual Studio project directory then it's probably a File reference.
When in doubt, remove the reference and re-add it appropriately.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello everyone,
I want to make a datagrid which has a column of Checkbox. By using DataGridBoolColumn class, I have done this. But, When my Application starts, the CheckBox Column will be in the checkstate of "Indeterminate". I want it to be "Uncheked". The CheckBox Control has an Attribute of CheckState, but DataGridBoolColumn hasn't this Attribute. How can i do this? Please help me.
A segment of my code:
DataGridTableStyle dgt = new DataGridTableStyle();
dgt.MappingName = "ok";
DataGridTextBoxColumn dgtbc = new DataGridTextBoxColumn();
dgtbc.MappingName = "Name";
dgtbc.HeaderText= "Name";
dgt.GridColumnStyles.Add(dgtbc);
dgtbc = new DataGridTextBoxColumn();
dgtbc.MappingName = "ID";
dgtbc.HeaderText= "ID";
dgt.GridColumnStyles.Add(dgtbc);
DataGridBoolColumn dgbc = new DataGridBoolColumn();
dgbc.MappingName = "Check";
dgbc.HeaderText = "Check";
dgbc.AllowNull = false;
dgbc.FalseValue = false;
dgbc.TrueValue = true;
dgt.GridColumnStyles.Add(dgbc);
this.dataGrid1.TableStyles.Clear();
this.dataGrid1.TableStyles.Add(dgt);
hope for help
|
|
|
|
|
Hi,
Try using System.Boolean DataColumn for the Checkbox column. I think this would do the job for you. Or else, check if you can set the Checkbox to 2 way input mode. Ie., Just True/False. There is a method to do it. I think it is by setting the ObjGridColumnStyle.NullText = ""; Try it, and let me know if it worked.
- Titan
Titan Williams
Sr. Systems Engineer
Indian
|
|
|
|
|
Hi Titan Williams,
The CheckBox Column in my program has been set to bool. In addition, the CheckBox column has only two states true/false by using the property AllowNull = false. But It doesn't work!
I don't find ObjGridColumnStyle class which you said.
Thanks for your reply. Can you have another method?
welspring
hope for help
|
|
|
|
|
Hi,
Try using System.Boolean DataColumn for the Checkbox column. I think this would do the job for you. Or else, check if you can set the Checkbox to 2 way input mode. Ie., Just True/False. There is a method to do it. I think it is by setting the ObjGridColumnStyle.NullText = ""; Try it, and let me know if it worked.
- Titan
Titan Williams
Sr. Systems Engineer
Indian
|
|
|
|
|
You didn't mention if you're binding the DataGrid at this point in your application's lifetime yet. If not, it will be indeterminate since there's no data backing it. If you have bound the DataGrid , then 1) make sure the DataColumn specifies a boolean data type and that you set the TrueValue and FalseValue properties of the DataGridBoolColumn if the defaults aren't sufficient (they are for SQL Server).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
Thanks for your reply! I think you are right for the reason that there are no data in the CheckBox datacolumn of the datatable backgrounded. I have solved the problem by filling data to the datacolumn.
Another problem is, when clicked in the end of the datagrid, a new row will be created. The CheckBox column of the new row will still be in indeterminate state. How to resolve this?
Thanks again.
Welspring
hope for help
|
|
|
|
|
It's in an indeterminate state because there's no actual data row created yet. If you want to default the value, you should either add a DataColumn to your DataSet with the DefaultValue property set, or do this a better way by creating a typed DataSet in the designer, which also facilitates data-bound control design in VS.NET as well as typed access to fields in your code editor. Read Generating a Strongly Typed DataSet[^] in the .NET Framework SDK, as well as ADO.NET Datasets[^] in the Visual Studio .NET product documentation for information about how to create typed DataSet s using the component designer (slick).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks a lot!
hope for help
|
|
|
|
|
To make this Yes or No do this: Make the 'Default' value in the corresponding column in the dataset table to Y or N.
I did this and it worked.
E.g. this.dsD_A_T_A_S_E_T1.EMP.PERM_EMPColumn.DefaultValue = "N";
I am of course using a 'typed dataset'. You can do this for normal datasets also.Like this:
this.dsD_A_T_A_S_E_T1.Tables["EMP"].Columns["PERM_EMP"].DefaultValue = "N";
How this helps
|
|
|
|
|
I have pulldown menu and I've assigned a DataSet as it's DataSource. Everything works great. At some point in my application I would like to assign a different DataSet to be its DataSource but for some reason its not working; I'm still seeing data from my first DataSet. I've tried assigning the DataSource property a null and then assigning my new DataSet but to no avail. What am I doing wrong ? Thanks in advance...
-Pete
|
|
|
|
|
You can use null then can bind the next datasource. But it seems that you already tried that. Ok. just call Refresh() methos of your control just before binding second datasource.;)
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I need a little guidance on a multithreaded application. The idea of the app is to have a machine send UDP packets to a server and the server will retrive the packets, parse out the data, and submit to a DB. I am initially looking at this as a multithreaded approach with the server being separated into 2 threads: 1) UDP retrieval, and place message into message queue, 2) send message from queue to DB.
i.e.
Class retriever
{
public retrievemsg()
{
while(true)
{
lock(queue)
{
//retrieve message and place on queue
}
}
}
}
Class Sender
{
public sendToDB()
{
while(queue not empty)
{
lock(queue)
{
//send msg info to DB
}
}
}
}
While I understand the concepts of multithreading and concurrency and the such, what I am having trouble with is since the threads are basically always running how will the CPU know to switch threads to execute the one that needs processing. For example, the UDP packets are going to arrive pretty regularly, but we still want regular service of the packets and the infomration should show up regularly into the DB. I don't want to explicitly say Thread.Sleep(0) because I am not exactly sure when is the best time, or it could change. How would I synchronize the running of these threads.
Thanks ahead of time
|
|
|
|
|
Your problem is the typical Producer-Consumer problem. One thread writes to the queue and the thread needs to know when the queue is not empty. You can use the AutoResetEvent class or the Monitor class to do the synchronization. Typical code will look like
Class retriever
{
public retrievemsg()
{
while(true)
{
lock(queue)
{
queue.Add(msg);
Monitor.Pulse(queue);
}
}
}
}
class Sender
{
public sendToDB()
{
lock(queue)
{
while(true)
{
Monitor.Wait(queue);
Msg msg = queue.Remove(msg);
}
}
}
}
You can also use the AutoResetEvent to signal the Sender that a message has arrived. The Sender will WaitOne() on the event and once signalled, will fetch the item.
Regards
Senthil
My Blog
|
|
|
|
|
Just my $0.02
UDP? Shouldn't you be using TCP instead? UDP makes no guarantees about the packets getting to their destination, let alone the order in which they get there! If you're adding information to a database, usually you want consistancy in the data that's going into it. TCP would be a much better choice, particularly over the Internet.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I own a charting application with a horizontal scroll bar that can be slid from side-to-side to view the entire chart (normal scrolling action). This scroll bar also has a grip at each end that can be used to expand/shrink its length, and thus expand/shrink the scope of the current viewing area (resulting in a zoom-in, zoom-out action).
Is this dual-action scroll bar built from a set of "stock" functions in .NET, or does it require a fully customized approach?
I would like to recreate this control in C#, and I would appreciate any information or example(s) that could help get me started. Thanks.
|
|
|
|
|
I think using frames can solve ur problem..by giving default size and scrolling properties u can get those two featurs mentioned by u in the query.
And rather than using any other customised controls, using frames in which ur chart resides will fulfill ur requirment.
As got lil busy with work..not able to send u any examples
|
|
|
|
|
Gamya,
Thank you for your response.
The charting application and the C# project that I am building are both Windows applications. As I understand, frames are useful only with Web based applications. Is this true?
Dennis
|
|
|
|
|
Hai
U r right..The frames concept can be applied only in Web apps..And As for windows apps..u have Horizontal and vertical scroll bars readily in ur tool box. U can use them in ur apps and write events as appropriate..
And there are plenty of articles avaliable in net about the usage of Scroll bars..And dont have any idea abt resizing the chart..
Regards
Gamya
|
|
|
|
|
Thanks Gamya.
I'll keep researching this. If I find any resizing/zoom info relating to scroll bars, I will post back to this thread.
|
|
|
|
|
And just now i found out that thru panels we can have the autoscroll set to true..
|
|
|
|
|
Cripes...I'm working up a very rudimentary database app with data-bound controls: load all records to datagrid and user can filter results by choosing elements from lists.
Problem: during app initialization, a button to reload datagrid with filtered results is being clicked repeatedly. I've isolated the routine in another function (not in button_click), and it is fired ~20 - 30 times during startup.
Any ideas on how/why this is happening?
|
|
|
|
|
Please check your code clearly and make sure databinding takes place in one place , which need to be after Initialization(). If you can show me, that cose block, then that will be very nice to trace the issue.;)
Sreejith Nair
[ My Articles ]
|
|
|
|