|
Hi,
I'm using the control SplitContainer on run time.
uppon request I'm generating a tab that contains SplitContainers.
I set all the properties as needed including the SplitterDistance,
BUT when the application is running the spliter is not positioned as expected.
it seems that it use some default parameter that ovveride the explicit setting.
Thanks for your help,
lune
|
|
|
|
|
Its hard to comment about it but a wild guess could be to check your dock and anchor properties.
|
|
|
|
|
The dock is fill.
and anchor is top and left.
I saw that if I set the parameter in an event such SelectedIndexChange it works.
but I feel that is wrong to do such a thing (and also it doesn't cover all the cases)
any other guess?
Thanks.
|
|
|
|
|
this comment made me think that may be its some code level change overriding the design view changes. Go through your code and make sure that your adjusted styles not being overridden at code level.
|
|
|
|
|
datagrid is having 4 values.
presently selection is on 4'th record and it is moving to 2'nd record...
how to get previously selected column index(i.e 4'th record) index.
can anyone help me
|
|
|
|
|
i got the code...
thank you...
if (gvcomments.Rows[pre_Index].Cells[CommonConstants.Created].Style.ForeColor == Color.Red)
{
gvcomments.Rows[pre_Index].DefaultCellStyle.Font = new Font(gvcomments.SelectedRows[0].InheritedStyle.Font, FontStyle.Bold);
}
else
{
gvcomments.Rows[pre_Index].DefaultCellStyle.Font = new Font(gvcomments.SelectedRows[0].InheritedStyle.Font, FontStyle.Regular);
}
|
|
|
|
|
handle related index change event and always keep track of previous index in some location. In this way you will always have a valid old index saved and before updating it to newer index you can make use of it.
|
|
|
|
|
Hi,
I'm writing TCP application to communicate with a server machine. There is an interesting thing called TCP Window Scaling, how can i achieve through C#?
|
|
|
|
|
satsumatable wrote: I'm writing TCP application to communicate with a server machine. There is an interesting thing called TCP Window Scaling, how can i achieve through C#?
Based on the Wikipedia definition of TCP Window Scale Option[^], it seems you don't achieve it at the application level.
|
|
|
|
|
Hello All;
i make a user control on c# using ultragrid control the problem is when i take the dll in order to use it in other projects the data doesnt appear, the grid reads the data from the data base
the code of the user control:
the grid name here is ulGrid
public partial class GridUserControl : UserControl<br />
{<br />
Infragistics.Win.UltraWinGrid.UltraGrid ulGrid = new UltraGrid();<br />
Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ulExcel = new UltraGridExcelExporter();<br />
Infragistics.Win.UltraWinGrid.UltraGridPrintDocument ulPrint = new Infragistics.Win.UltraWinGrid.UltraGridPrintDocument();<br />
<br />
<br />
bool GridRightLeft;<br />
string HeaderTitle;<br />
string HeaderRightDetails;<br />
string HeaderLeftDetails;<br />
<br />
public GridUserControl()<br />
{<br />
InitializeComponent();<br />
ulItasGrid.ContextMenuStrip = contextMenuStrip1;<br />
}<br />
<br />
public delegate void GridEventKeyDown(object sender,KeyEventArgs e);<br />
public delegate void GridEventKeyUp(object sender, KeyEventArgs e);<br />
public delegate void GridEventMouseDown(object sender, KeyEventArgs e);<br />
public delegate void GridEventMouseClick(object sender, KeyEventArgs e);<br />
<br />
<br />
<br />
<br />
public bool GridRightToLeft<br />
{<br />
set<br />
{<br />
GridRightLeft = value;<br />
}<br />
get<br />
{<br />
return GridRightLeft;<br />
}<br />
}<br />
<br />
<br />
public string LeftDetails<br />
{ <br />
set<br />
{<br />
HeaderLeftDetails = value;<br />
}<br />
get<br />
{<br />
return HeaderLeftDetails;<br />
}<br />
}<br />
public string RightDetails<br />
{<br />
set<br />
{<br />
HeaderRightDetails = value;<br />
}<br />
get<br />
{<br />
return HeaderRightDetails;<br />
}<br />
}<br />
DataTable dt = new DataTable();<br />
public DataTable DataTableSource<br />
{ set<br />
{<br />
ulGrid.DataSource = dt;<br />
}<br />
<br />
<br />
get<br />
{<br />
return dt;<br />
}<br />
<br />
}<br />
<br />
<br />
public object DataSource<br />
{<br />
get<br />
{<br />
return ulGrid.DataSource;<br />
}<br />
set<br />
{<br />
ulGrid.DataSource = value;<br />
<br />
try<br />
{<br />
ulGrid.DataBind();<br />
}<br />
catch (Exception ex)<br />
{<br />
throw new Exception(String.Format("Could not bind data to grid"));<br />
}<br />
}<br />
}<br />
<br />
public string DataMember<br />
{<br />
set { ulGrid.DataMember = value; }<br />
get { return ulGrid.DataMember; }<br />
<br />
}<br />
<br />
<br />
<br />
public string HeaderReport<br />
{<br />
set<br />
{<br />
HeaderTitle = value;<br />
}<br />
get<br />
{<br />
return HeaderTitle;<br />
}<br />
}<br />
<br />
public AutoFitStyle AutoFit<br />
{<br />
set<br />
{<br />
this.ulItasGrid.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;<br />
}<br />
get<br />
{<br />
return this.ulItasGrid.DisplayLayout.AutoFitStyle;<br />
}<br />
}<br />
<br />
public Color Appearance<br />
{<br />
set<br />
{ <br />
this.ulItasGrid.DisplayLayout.Appearance.BackColor = Color.White;<br />
}<br />
get { <br />
return this.ulItasGrid.DisplayLayout.Appearance.BackColor;<br />
}<br />
}
and the code of the connection class for testing the grid:
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Data.SqlClient;<br />
using System.Configuration;<br />
using System.Data;<br />
<br />
<br />
namespace testthegrid<br />
{<br />
class Connection<br />
{<br />
SqlConnection ConnectionStr = new SqlConnection();<br />
<br />
public Connection()<br />
{<br />
ConnectionStr.ConnectionString = "Data Source=.; Initial Catalog=GridExample;Integrated Security=SSPI";<br />
}<br />
<br />
public SqlConnection conn<br />
{<br />
get<br />
{<br />
return this.ConnectionStr;<br />
}<br />
set<br />
{<br />
this.ConnectionStr = value;<br />
}<br />
}<br />
<br />
<br />
public void OpenConnection()<br />
{<br />
if (ConnectionStr.State != ConnectionState.Open)<br />
ConnectionStr.Open();<br />
}<br />
<br />
<br />
public void CloseConnection()<br />
{<br />
try<br />
{<br />
if (ConnectionStr.State != ConnectionState.Closed)<br />
ConnectionStr.Close();<br />
}<br />
catch { }<br />
}<br />
}<br />
}
and the code for testing the grid is:
<br />
namespace testthegrid<br />
{<br />
public partial class Form1 : Form<br />
{<br />
private Connection connection = new Connection();<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
FillGrid();<br />
}<br />
private void FillGrid()<br />
{<br />
connection.OpenConnection();<br />
DataTable dt = new DataTable();<br />
SqlDataAdapter da = new SqlDataAdapter("select * from AccountInfoA", connection.conn);<br />
da.Fill(dt);<br />
gridUserControl1.DataTableSource = dt;<br />
connection.CloseConnection();<br />
<br />
}
there is no data appears in the grid
thanx a lot
|
|
|
|
|
Try setting up the binding BEFORE you read the data.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
thanx, but it doesnt solve the problem!!
|
|
|
|
|
Hello all,
I would like to save current word file to My Documents when user clicks on Button which is Placed in Ribbon ????
Can anybody guide me how to do it ???
|
|
|
|
|
I would like to save current word file to My Documents.
means?
Why you are using savedialogbox when you have to save it in MyDocuments only
Cheers!!
Brij
|
|
|
|
|
i would like to save the word file on onclick event of my Button which is in Ribbon .....i don't want to use office inbuilt saving option.....
|
|
|
|
|
Ummm .... SaveFileDialog and System.IO.File.AppendAllText.
I'm pretty sure your going to have to double check the names
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hi all,
I've created a windows application through C# to add appointment in outlook 07 programatically. now i want to perform some action as soon as a new contact is added in the outlook i.e. i want to handling add contact event. please help me.
|
|
|
|
|
Check this event
Outlook.Inspectors OutlookInspectors
|
|
|
|
|
thnx. i've created an addin and successfully captured add/modify event for appointment. now for normal appointment modifcation as well as for drag n drop same event modify is gets fired. now i want to diferentiate between normal modificATION and modification through drag n drop.
|
|
|
|
|
Hi,
I have a panel on a windows form.
In the panel, I have a label, I have set the visible property of the label as False in design time.
now at runtime, in a function I am trying to make label visible like this,
label1.visible = true;
but the label1.visible property does not change, it still has false value, but once the form executes completely, label becomes visible, I cannot understand, How this is happening.
can someone tell me that why the label1.visible property does not become true, when I explicitly assign true to it.
Thanks in advance,
Regards
Mahesh
|
|
|
|
|
Mahesh_Blr wrote: but once the form executes completely
It sounds like you are running a process that is holding up the UI, basically the form is not being refreshed until the process is complete. Adding the following line after settings the visible property of the label to true should work..
label1.Visible = true;
form1.Refresh();
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Mahesh_Blr wrote: but once the form executes completely
What do you mean by this?
If you are calling a function which takes a long time to exexute and you are changing the property inside that than it will only appear after the task.
You may look at Backgroundworker to prevent this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Welcome to the wonderfull world of visible !!
This is a really good example of stupidness within the framework. The setter flags that you <want the="" control="" <i="">to be visible. The getter reports if the control is visible. The two are not the same, you can also see the same behaviour with enabled .
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
So the situation is the folowing
Inside a tabview control; i add programaticly a number of tabs (the number is not fixed); on each tab i add a listview. My question is how do i add an event item so that when i click any item from any list i fill a textbox with something from that item; my code looks like this
public void lv_SelectedIndexChanged(object sender, EventArgs e)
{
while (n!=0)
{TabPage tp=new TabPage();
tabControl1.TabPages.Add(tp);
ListView lv = new ListView();
tabControl1.TabPages[k].Controls.Add(lv);
n--;
}
}
I've written just a portion of the code.Help will be apreciated.Thank you in advance.
Alex.
|
|
|
|
|
Immediately after creating the new listview instance, subscribe to the desired event.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|