|
Hi.
Did you work with Crystal Report ?
I want to write a program like to Crystal Report.I don't know how can I explaine it.
Any way thanks for your attention.
Akbar
|
|
|
|
|
How can I make it so that my datagrid columns span the width of my datagrid, when I get my dataset?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
this.dataGrid1.SizeChanged += new EventHandler(this.OnSizeChanged);
private void OnSizeChanged(object sender, System.EventArgs e)
{
Trace.WriteLine("OnSizeChanged Event Handler.");
try
{
this.AdjustColumnsWidth();
this.AdjustDynamicControls();
}
catch (Exception exception)
{
if ( exception.InnerException != null )
{
MessageBox.Show(exception.InnerException.Message);
}
else
{
MessageBox.Show(exception.Message);
}
}
}
private void AdjustColumnsWidth()
{
foreach ( DataGridTextBoxColumn dgtc in this.dataGridTableStyle.GridColumnStyles )
{
dgtc.Width = 80;
}
}
Alomgir Miah
Live Life King Size
|
|
|
|
|
I think that you are miss understanding what I want. I want my datagrid to spread out the columns across the top of the grid depending on the number of tables.
Currently my code is setting a fix size but I cannot even get that working. Do you have any suggestions?
<br />
GridColumnStylesCollection gcsColl = StudenDataGrid.TableStyles["Student"].GridColumnStyles;<br />
for (int i = 0; i<gcsColl.Count; i++)<br />
{<br />
if (gcsColl[i].GetType() == typeof(DataGridTextBoxColumn))<br />
{<br />
DataGridTextBoxColumn textColumn = (DataGridTextBoxColumn)gcsColl[i];<br />
textColumn.Width = 150;<br />
}<br />
}<br />
<br />
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hey ,
You want to spread the columns depending on the number of tables or columns? I think I did not understand your question. Assuming you want to spread the columns depending on the number of columns implement AdjustColumnsWidth as. Hope this helps
private void AdjustColumnsWidth()
{
this.isColumnWidthAdjusting = true;
int verticalScrollBarWidth = this.globalEntitySearchGrid.VerticalScrollWidth;
int currentWidth =
this.dataGridTextBoxColumnExConjunction.Width +
this.dataGridTextBoxColumnExEntity.Width +
this.dataGridTextBoxColumnExOperator.Width +
this.dataGridTextBoxColumnExValue.Width +
DELTAFACTOR + this.gridTableStyle.RowHeaderWidth;
int gridClientWith = this.globalEntitySearchGrid.ClientSize.Width - verticalScrollBarWidth;
if (currentWidth > gridClientWith)
{
int delta = currentWidth - gridClientWith;
this.UnWireResizeEvents();
this.dataGridTextBoxColumnExConjunction.Width = this.dataGridTextBoxColumnExConjunction.Width - delta / 4;
this.dataGridTextBoxColumnExEntity.Width = this.dataGridTextBoxColumnExEntity.Width - delta / 4;
this.dataGridTextBoxColumnExOperator.Width = this.dataGridTextBoxColumnExOperator.Width - delta / 4;
this.dataGridTextBoxColumnExValue.Width = this.dataGridTextBoxColumnExValue.Width - delta / 4;
this.RefreshGrid();
this.WireUpResizeEvents();
this.AdjustDynamicControls();
}
else if (currentWidth < gridClientWith)
{
int delta = gridClientWith - currentWidth;
this.UnWireResizeEvents();
this.dataGridTextBoxColumnExConjunction.Width = this.dataGridTextBoxColumnExConjunction.Width + delta / 4;
this.dataGridTextBoxColumnExEntity.Width = this.dataGridTextBoxColumnExEntity.Width + delta / 4;
this.dataGridTextBoxColumnExOperator.Width = this.dataGridTextBoxColumnExOperator.Width + delta / 4;
this.dataGridTextBoxColumnExValue.Width = this.dataGridTextBoxColumnExValue.Width + delta / 4;
this.RefreshGrid();
this.WireUpResizeEvents();
this.AdjustDynamicControls();
}
this.isColumnWidthAdjusting = false;
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
Or this would work too:
DataGridTableStyle style = new DataGridTableStyle();<br />
style.MappingName = dataTable.TableName;<br />
foreach (DataColumn column in dataTable.Columns)<br />
{<br />
DataGridTextBoxColumn gridColumn = new DataGridTextBoxColumn();<br />
gridColumn.MappingName = column.ColumnName;<br />
gridColumn.HeaderText = column.ColumnName;<br />
gridColumn.Width = StudenDataGrid.Size.Width / accessDataSet.Tables["Student"].Columns.Count;<br />
style.RowHeadersVisible = false;<br />
<br />
style.GridColumnStyles.Add(gridColumn);<br />
}<br />
<br />
StudenDataGrid.TableStyles.Add(style);<br />
this.StudenDataGrid.DataSource = accessDataSet.Tables["Student"];<br />
This will autosize the column headers according to the number of columns you have in your dataset.
Thanks for the help.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hello...
I'm trying to compile my DLL. I compiled it 2 times. Between 2 compiling I didn't change anything. How can I get difference DLL ?
|
|
|
|
|
Stanley Caramoy wrote:
Between 2 compiling I didn't change anything. How can I get difference DLL ?
WHAT?? If you didn't change anything, there won't be any differences.
Or, like I said, WHAT? I don't understand what your asking. "Difference DLL"???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
under build hit clean solution or clean [app_name] then choose rebuld all.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
how can recreate this splitter effect of line transparent how you can see here:
|
|
|
|
|
Hello ,
I wanted to know how u draw lines on a MDI form in C# to display four quadrants on the screen
|
|
|
|
|
hi to all,
how can i disable a text box without changing the forecolor to gray.
what i want is to disable the text box and to keep the forecolor to black.
i don't want to use the readonly property because the back color is still white.
best regards and thanks in advance
fady
|
|
|
|
|
Those are your only options while still using a TextBox.
A little trick I've seen used before is to create equivilent label controls, set them up to look like the textboxes, and put them behind their textbox counterparts. Then when the textboxes needed to become ReadOnly without the readonly look, they just set the TextBox.Visible property to false.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
how can i make my application stay in the real memory and not in the pagefile?
how can i do the same to a specific object?
|
|
|
|
|
|
mybe there's a way to tell windows to reserve space for a process in the Physical Memory?
|
|
|
|
|
Perhaps yes. But within CLR's realm and through C#, it may not be, since all Memory Management is purely controlled by CLR.
You may need to venture out into direct C++ programming and delve into Windows APIs for that. Is'nt it?
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
This isn't possible to do in a .NET Framework Managed application.
You'll have to write your app in unmanaged C++ to get this to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would to simulate the lines that appear when i move a splitter.
How could i show that when i move a pannel used as a splitter?
|
|
|
|
|
Hi all,
I would like to know is it possible to switch between mulitple profiles within the same application?
I have a problem that once I logon a profile, I find no means to switch to another profile. I have tried to use logoff method but it fails, it still stays with the original profile.
|
|
|
|
|
Hello
I'd like to have a text box that I can selectively put a little red triangle in the top right corner of, pretty much in the same way excel does when you have comments on a cell. I had a look at handling the Paint event for the text box but it doesn't seem to be getting fired. Is there something more than assigning my own handler function to the paint event delegate to achieve this? I haven't inherited from the text box control, could this be the problem?
BTW If it's not obvious I'm pretty new to .NET
Cheers
David
|
|
|
|
|
You may need to set the textboxes ControlStyles.UserPaint style bit (Texbox1.SetStyle( ControlStyles.UserPaint)) in order for the paint event to fire.
If you plan on having several of these, it might be worthwhile to create your own by subclassing (inheriting from) it, so that you dont have to repeat a lot of code.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Hello Rob
Thank you for your answer. I've been looking for a property or something, and now it looks like I've found it...with your help of course
The main reason I didn't want to inherit from the text box is that I want to implement this feature as a kind of decorator that I can use on a selection of controls. I'm creating a control manager that will create the controls dynamically, and a "state" manager that will manage standardised sets of functionality based on what the user is doing e.g double click on a text box to display a window containing a list of values. Having the red triangle...or any other visual cue, will be the indicator to the user that they can double click to get the window.
I'm not adverse to inheriting controls, but if possible, I'd rather stick to standard controls and manipulate them wherever possible. Do you think I'm approaching this in the right way?
Thanks
David
|
|
|
|
|
in my application i have to use oracle connection but i can't reach database with which computers have oracle 9 or higher,
can u help me
tnx
|
|
|
|
|
What error do you get?
No hurries, no worries.
|
|
|
|