|
Hello all,
I've searched almost all the web but I didn't find any clue to help me...
My datagrid is bound dynamically to a collection of objects (let's say with fields : name, age, sex, phone).
All mapping names are done in the order I want to see them on screen : name, age, sex, phone.
When I execute the code, the fields appear in a different order, sex, name, age, phone.
I tried to remove all TableStyles, it still works with this ugly order.
I tried to change properties in TableStyleDescription (for example, width of a column) but nothing changes.
Any clue to help me ?
Thanks
|
|
|
|
|
You need to add the tablestyles before assigning the datasource, otherwise the datagrid (in its infinite wisdom) auto-generates the table styles.
This one has got me on more than one occasion
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Thanks for your answer.
But as I said first, tablestyles were created at design time and however, column order was not right...
|
|
|
|
|
one word file contains the text,tables and pictures, we stored that word file in a database as a type of "image".
and then, i need to retrieve those data from database, and those data is placed in a textarea control, but it is displaying some ascii characters in textarea for any tables or for any pictures but it is displayed text as it is. Now i want to display the tables and pictures also along with text in textarea control without ascii values. Plz give me suggestions for this problem
Thank u,
bye,
kedarnadh k.
kedarnadh k.
|
|
|
|
|
|
You will have to use some other control then a TextBox.
You can save the word file into RTF, and then simply display it inside a RichTextBox.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi Guys!!
need a little help
i m developing a window application in which there are many textboxes Richtextboxes checkbox etc i want to reset these controls on a button click
so i decided to make a function something like this
void Clear(ref Control ctrl)<br />
{<br />
if(ctrl.GetType().Name=="TextBox"}<br />
{<br />
ctrl.text="";<br />
}<br />
}
and so on.
but when i pass the Textbox referece something like this
TextBox textbox1;<br />
Clear(textbox1);
it gives an Error That Window.Form.TextBox cannot be Passed as Window.form.Control. as Argument
i dont understand as textbox is also a control...
can any one help me .. what i m missing...
Thanks....
Abhinav
|
|
|
|
|
It is because your method takes a reference to a reference to a control. You have to do one of 2 things:
1- Redefine your method as void Clear(Control ctrl)
or
2- Change your calling code to Clear(ref textbox1);
Personnally, I would go with 1.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Might I also suggest that you change the validation of the control to something like:
if (ctrl is TextBox)
{
((TextBox)ctrl).Text = "" ;
}
It's just a bit cleaner, in my opinion.
|
|
|
|
|
I am working on a Windows application developed in C#. The Windows application is required to capture the user inputs from active Internet Explorer instance (not included as a web browser control within Windows application). For example, when user clicks on “Submit” button in the browser, the Windows application should be able to capture that event and also capture the text box values from the relevant web form. A similar situation is that the Windows application should also have a capability to populate the text boxes of a web form rendered by Internet Explorer.
To summarize, I need to implement an interface between my Windows application and the Internet Explorer so that the windows application is able to read from Internet Explorer and also populate the values in Internet Explorer. This involves the following:
1. Trapping the “Submit” (button click) event from Internet Explorer and Capturing text boxes in the Internet Explorer.
2. Trapping the page load event from Internet Explorer and populating the textbox in the Internet explorer.
I have searched for the related topics on web and also MSDN, I found that BHO (Browser Helper Object) is one of the option. I have tried to implement the BHO interface based on few samples that I found on some of the sites. However, it is not working yet.
Therefore I thought I would grab this opportunity to take help from the expertise involved with this Forum. Any inputs / ideas will be very helpful for me to progress in right direction.
I look forward to your response.
Thank you and regards,
nw.knowledge
|
|
|
|
|
BHO's are the work of the devil.
What you describe sounds like some form of keylogger/spyware.
I hope that nobody gives you an answer until you describe, in detail, the purpose of the application you are writing.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
How to register the BHO to work with the browser. ?? I am registering it with regasm option. Does the GUID need to be generated a new or it works when copied form the sample of Autosig. I specify the GUID as shown below
namespace ClassLibrary1
{
// Import IObjectWithSite interface
[
ComVisible(true),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")
]
public interface IObjectWithSite
{
[PreserveSig]
void SetSite([In ,MarshalAs(UnmanagedType.IUnknown)] object pUnkSite);
[PreserveSig]
//void GetSite(ref Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppvSite);
void GetSite(ref Guid guid, out IntPtr ppvSite);
}
///
/// Definition for the BHO class that will be instantiated by the browser.
/// IE will be looking for the IObjectWithSite interface to invoke SetSite()
/// and pass this component the container site.
///
[
ComVisible(true),
ClassInterfaceAttribute(ClassInterfaceType.None),
GuidAttribute("5ADEFB9E-B824-45e6-86E2-2B7941F5D6A3")
]
public class ClassLibrary1: IObjectWithSite
{
}
And how can i know after registeration that my dll has been registered. ??
Please confirm / correct my understanding
Thanks and Regards
nwknowledge
-- modified at 2:14 Wednesday 26th April, 2006
|
|
|
|
|
I have a dataGrid in which 3 coulmns I can update. When I click Edit I Update and Cancel linkcomes up. All three becomes TextBox in which I can enter the data after clicking the update it updates the value.
Now out of 3 textBox one i want to become DropDown list and when they select one value it updates that value.
Any Ideas or suggestion are really appericiated.
Thanks
|
|
|
|
|
Hi.
I was wondering if anyone has a solution to my problem.
I'm currently working with an application that consists of a Datagrid containing files
and filedata. As long as I don't sort the table, using columnheaders, retrieving the
selectedindex and deleting it from the DataTable is of no problem.
But when I sort the DataGrid my indexes become like this:
Before sorting: => After sorting on i.e. column "Fileset":
------------------------------------------------------------------------------------------
[Grid/Table index 0] File1.txt FilesetB => [Gridindex 0][Tableindex 3] File4.txt FilsetA
[Grid/Table index 1] File2.txt FilesetC => [Gridindex 1][Tableindex 0] File1.txt FilsetB
[Grid/Table index 2] File3.txt FilesetC => [Gridindex 2][Tableindex 4] File5.txt FilsetB
[Grid/Table index 3] File4.txt FilesetA => [Gridindex 3][Tableindex 1] File2.txt FilsetC
[Grid/Table index 4] File5.txt FilesetB => [Gridindex 4][Tableindex 2] File3.txt FilsetC
If I highlight File3.txt after sorting, I retrieve DataGrid index 4, but index 4 in the DataTable equals File5.txt, and this file is deleted instead.
Is there a way of either retrieving data from the grid that I can search for in table for deletion,
or sorting the table to match indexes with the grid, or lastly synchronize the grid and the table?
I'm kinda new to DataGrids and the only way I know of getting data is through DataSets.
I'd really appreciate some feedback
Best regards!
-Larantz-
-- modified at 8:34 Tuesday 25th April, 2006
|
|
|
|
|
Hi,
the DataGrid has an indexer which you could use:
object value = myGrid[0, 1];
The other possibility would be to access the data through the DefaultView of the table you have bound to the grid. It is the one actually doing the sorting and thus accessing the data with it will always be in the correct order.
|
|
|
|
|
How to change database in runtime??
I am using VS2005 and SQL 2005.
If I change connection string in AppConfig in runtime the app needs to be restarted to connect to new database.
Databases are completly the same schema but with different amount of data.
Strong type tableadapters do not have connection string property exposed.
thx
|
|
|
|
|
When you change something in the configuration file, you have to restart the application, except for ASP applications. You have to modify your application to notice those changes, but that requires extra work.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Ok, it's the extra work I am interested in.
Is there a way to make strong type TableAdapters (introduced in VS2005) to point to another connection string(another database but same with schema) in AppConfig at runtime?
thanx
|
|
|
|
|
I am not familiar with those. You would probably have to modify the generated code to achieve that.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
i want to know how to rotale the images in the cycle view.it should impress as 3d view .As exsample if 3 images should rotate in cycle with related links
eg : microsoft encarta 2005 picture rotating view. please give ideas
Amal
|
|
|
|
|
I have the following code which updates a tree view when called. For some reason beyond me, the second time it is called (foreach (Contact c in contacts) is previously called, so this is invoked for each new addition to the treeview), it produces a NullReferenceException unhandled error.
public void UpdateContactGroup(Contact contactIn)<br />
{<br />
if (this.trvContacts.InvokeRequired)<br />
{<br />
UpdateContactGroupCallBack d = new UpdateContactGroupCallBack(UpdateContactGroup);<br />
this.Invoke(d, new object[] { contactIn });<br />
}<br />
else<br />
{<br />
TreeNode newNode; <br />
if (!trvContacts.Nodes.Contains(new TreeNode(contactIn.Group)))<br />
{<br />
newNode = new TreeNode(contactIn.Group );<br />
trvContacts.Nodes.Add(newNode);<br />
}<br />
newNode = new TreeNode(contactIn.Username);<br />
trvContacts.Nodes[contactIn.Group].Nodes.Add(newNode);<br />
}<br />
}
Also, when hovering over the error in debugging mode, all the fields are shown to be present.
Another method using the invoke called updating a rich text box works fine all the time.
Can anyone tell me what I'm doing wrong?
|
|
|
|
|
How i will integrated collection process in asp.net.
can u provide code or link where r integrated collection
|
|
|
|
|
hi...
I'am in wonder whether its possible to generate a "rdlc" file, add some data regions and finally pass a dataset to it dynamically.
I'am going to generate a user control that has a dataset and use this dataset to create a report on the fly.
Would you please help me?
Thank you in advanced...
|
|
|
|
|
I wrote a C# windows application, in Visual Studio 2005,
that will email certain files to certain people at a certain
time every day. This program have to run permanantly to check the time.
How do I make the program run in the background and have only a
system tray icon on which you click to maximize the app??
-- modified at 7:28 Tuesday 25th April, 2006
|
|
|
|
|
Why don't you search before you post questions like this?
click
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|