|
You Can Insert Text at specific posiotion by do something like that Which will insert the code after the six charachters in richtextbox
richTextBox1.SelectionStart=6;
richTextBox1.Paste();
MCAD
|
|
|
|
|
Hello,
If I have:
dataview.ListChanged += new System.ComponentModel.ListChangedEventHandler(this.dataview_ListChanged);<br />
dataview.Table.ColumnChanged += new DataColumnChangeEventHandler (this.dataview_ColumnChanged);
To unhook those event from my dataview, do I just replace the + sign with -?
Thank you
|
|
|
|
|
Yes if you want to unsubscribe to an event use -=
MCAD
|
|
|
|
|
Hello,
I have a datagrid for which I sort a column through code. I don't want the user to able to sort the columns, so I have set the
datagrid.AllowSorting = false;
When I open the form, the user can still sort the columns.
After searching the internet, I've found that if you use TableStyles that you have to set the AllowSorting property of that TableStyle to false, because it overwrites the datagrid's AllowSorting property.
But when I open the form, the user can still sort the columns.
Are there other properties to set to not allow the user to sort?
thx in advance,
kalliet
|
|
|
|
|
Figured it out!
I was on the right track (TableStyle.AllowSorting = false), but because I moved the columns I had to create a new TableStyle and I forgot (shame on me!) to copy the AllowSorting property in the new datagrid.
So for any of you who are interested :
if you use sorting on a datagrid and you use TableStyles :
set the TableStyle.AllowSorting property to the datagrid.AllowSorting property, because it overwrite the datagrid's property !!
kalliet
|
|
|
|
|
hi all,
I need to get path of MDF and LDF files of a database("stock") in SQL Server.
Can I get path of both files using C# ?
thanks in advance..
|
|
|
|
|
You can easily achieve this by using SQL DMO.
SQLServer2Class sqlServerSource = new SQLServer2Class();
SQLServer2Class sqlServerdestination = new SQLServer2Class();
//Connect to source database
sqlServerSource.LoginSecure = true;
sqlServerSource.Connect(serverName, null, null);
foreach (_Database databaseClass in sqlServerSource.Databases)
{
if (databaseClass.Name.ToLower().Trim() == databaseName.ToLower().Trim())
{
foreach (FileGroup fileGroup in databaseClass.FileGroups)
{
foreach (DBFile dbFile in fileGroup.DBFiles)
{
sourceFileNamePhysical = dbFile.PhysicalName.Trim();
}
}
break;
}
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
How create setup project in C# including the .NET Framework
Thankx
|
|
|
|
|
|
You can use Microsoft Setup and Deployment Project.
http://www.codeproject.com/dotnet/CustomizingInstallers.asp
Live Life King Size
Alomgir Miah
|
|
|
|
|
You may want to check out inno setup as I found it easier to use.
p.s. It is free!
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
Hi all,
I am overridding WndProc method in C# for RichTextBox to handle the paste functionality.If i inherit TextBox, the message id 0x0302 gives WM_PASTE handler, but if i use RichTextBox it is not working. Is there any specific WM_PASTE message id for rich textbox. How can i know various MessageIds for RichTextBox.
|
|
|
|
|
Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name.
The code:
MyListBox.DataSource = MyObject<br />
MyListBox.ValueMember = "ID"
MyListBox.DisplayMember = "SubObject.Name"
|
|
|
|
|
DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this.
Anil Joshi
|
|
|
|
|
This has nothing to do with SQL. The data is coming from a Xml-File. But that is not the point. What MyListBox.ValueMember = "ID" does is bind it with a Property in the already bound MyObject. So the question remains is it possible to use a property of a property as a DisplayMember?
/Johan
|
|
|
|
|
Hi everybuddy,
I'm required to submit project on Mail Server after approx 2 months using .NET technologies (ASP.NET or C#.NET) but I dont know wat is a background functionality of the mail server
Please tell me how could i start the project and form which site(s)/forum(s) i can get the information about the functionality of a Mail Server
HELP ME Pleeeease,
|
|
|
|
|
|
Hello,
I have a window application with a datagrid on it. (Data bound from a dataset). Each row has an order number (stoporder).
Now I want the user to be able to move the rows up and down with an up and down button(and automatically change the number).
I can do this ok, if I manually click the order number first. (Then my rows move up and down and the number alters.) But how can I do this in the code? If I sort on any other column, then the up/down goes wrong too.
<br />
private void btnRouteStopUp_Click(object sender, System.EventArgs e)<br />
{<br />
DataRow row;<br />
int stopOrder;<br />
DataRowCollection rowCollection;<br />
int inc;<br />
<br />
try <br />
{<br />
row = GetRouteStopsRow ();<br />
dtRouteStops.UnSelect(dtRouteStops.CurrentRowIndex);<br />
inc=dtRouteStops.CurrentRowIndex;<br />
<br />
if (null != row) <br />
{<br />
stopOrder = Convert.ToInt32(row[FLD_STOPORDER]);<br />
if (stopOrder > 1) <br />
{<br />
stopOrder -= 1;<br />
row[IMS.FLD_STOPORDER] = 0;<br />
rowCollection = m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows;<br />
foreach (DataRow rowMove in rowCollection) <br />
{<br />
if (DataRowState.Deleted != rowMove.RowState) <br />
{<br />
if ((row != rowMove) && (Convert.ToInt32(rowMove[FLD_STOPORDER]) == stopOrder)) <br />
{<br />
rowMove[FLD_STOPORDER] = stopOrder + 1;<br />
row[FLD_STOPORDER] = stopOrder;<br />
break;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}<br />
dtRouteStops.Select(inc-1);<br />
}<br />
catch (System.IndexOutOfRangeException ex)<br />
{}<br />
catch (Exception exc) <br />
{}<br />
}<br />
<br />
private void btnRouteStopDown_Click(object sender, System.EventArgs e)<br />
{<br />
DataRow row;<br />
int stopOrder;<br />
DataRowCollection rowCollection;<br />
int inc;<br />
<br />
try <br />
{<br />
row = GetRouteStopsRow ();<br />
dtRouteStops.UnSelect(dtRouteStops.CurrentRowIndex);<br />
inc=dtRouteStops.CurrentRowIndex;<br />
if (null != row) <br />
{<br />
stopOrder = Convert.ToInt32(row[FLD_STOPORDER]);<br />
if (stopOrder < m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows.Count) <br />
{<br />
stopOrder += 1;<br />
row[IMS.FLD_STOPORDER] = 0;<br />
rowCollection = m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows;<br />
foreach (DataRow rowMove in m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].Rows) <br />
{<br />
if (DataRowState.Deleted != rowMove.RowState) <br />
{<br />
if ((row != rowMove) && (Convert.ToInt32(rowMove[FLD_STOPORDER]) == stopOrder)) <br />
{<br />
rowMove[FLD_STOPORDER] = stopOrder - 1;<br />
row[FLD_STOPORDER] = stopOrder;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
dtRouteStops.Select(inc+1);<br />
}<br />
catch (System.IndexOutOfRangeException ex)<br />
{}<br />
catch (Exception exc) <br />
{} <br />
}<br />
Any suggestion?
thx in advance,
kalliet
|
|
|
|
|
what I forgot to add :
dtRouteStops is the name of my datagrid
m_dataSetRouteStops is the name of my dataset
kalliet
|
|
|
|
|
in the load method, I added :
m_dataSetRouteStops.Tables[TBL_ROUTESTOPS].DefaultView.Sort = "stopOrder asc";
The column is now sorted from the start, which makes the up/down go OK.
Now I have a new problem : how do I set the grid on sorting not allowed? (so the user cannot sort on other columns)
I've tried the property :
dtRouteStops.AllowSorting = false;
but when the form appears I CAN sort on columns of the datagrid ????
any ideas?
thx in advance,
kalliet
|
|
|
|
|
hi
i want to include dll for reading and writing data from parallel port in NT base windows.
now i have a dll for this perpose but it not include in c#.
plz tell me how to inculde dll. and if, for this perpose handler will create then how create that handler and how use the dll.
reply me soon
bye.
|
|
|
|
|
I have a public static function in a class named "PublicFunctions". I call this function in my MDI form's "MdiChildActivate" event. What the function do is, it takes current activeMdiChild as argument and set a public variable present in this activeMdiChild. All the child forms have this public variable "formCurrentMode", which i use to store form's current mode like "update","save","new" etc.
My problem is, in my public static function in class "PublicFunctions" i am getting an error that 'System.Windows.Forms.Form' does not contain a definition for 'FormCurrentMode'.
Please help me to solve this problem.
Thanks
Sheel
Sheel Gohe
|
|
|
|
|
I have a question which I am sure someone has had before me:
when implementing drag'n'drop for a treeview control I have no problem, except that when dragging over an area in the treeview control which is empty (lets say i have only three nodes, but the control is much higher than this), The drop operation is not allowed, only when dragging onto previous nodes. Why is that? Can I do something about it in an easy way?
thankful for help,
Bjørn
|
|
|
|
|
Hello,
i have read on msdn the documentation referring to DPAPI. i have also tried those examples and when i have reached the user store problem i have noticed that there is an access conflict on DataProtector constructor (when i try to initalize an DataProtector object) so firstly i set the COM+ DPAPI Helper Application to run as a service (as in msdn's example) and it didn't work. secondly i set the COM+ application to run as library and it worked . my little question is what should i do to make DPAPI work in user store problem
Thanks, claudia
|
|
|
|
|
In vb.net when i declare a variable as object type then i can set any property for that object that is not assigned at design time but but will be assigned at runtime. for example:
dim a as object
if typeof a is textbox then
a.name="test1"
end if
The above code will not give any error at design time in vb.NET but in C# it will give an error during design time only - "'object' does not contain a definition for 'name'".
Please help me,how do i solve this problem.
Thanks in advance
Sheel
Sheel Gohe
|
|
|
|