|
Great! thanks for your help
|
|
|
|
|
is dataset and recordset the same thing? how r they different?
CODER
|
|
|
|
|
A DataSet is a disconnected recordset. All the data is contained in the DataSet so you don't need to fetch from the server again. This makes serialization (either to a file or for Web Services / Remoting) easy, as well as using diffgrams (change records in a DataSet ) to update a data source using a DataAdapter ( or handling it yourself ).
See the section on ADO.NET in the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hello all,
Its a well known fact that Panels in ASP.NET can be controlled using <asp:linkbutton> control. My questions is if we could control those same Panels using the <asp:radiobutton> control.
Now this should be done in this way:
1. Lets say there are 4 RadioButtons(of the same group) and 4 corresponding panels.
2. User chooses a RadioButton.
3. The corresponding panel opens up.
NOT in this way:
1. There are 4 RadioButtons(of the same group), 4 corresponding panels and a regular button.
2. User chooses a RadioButton.
3. User clicks on the regular button (lets say its the "Submit" button).
3. The corresponding panel opens up.
Any input is appreciated.
Regards,
Tiruvan
|
|
|
|
|
This has little to nothing to do with ASP.NET - this requires client-side scripting. ASP.NET is a service that runs on the server. Without fetching a new page, ASP.NET isn't involved (this is the nature of HTTP). You can generate a class that exhibits this behavior by emiting a script that reacts to the 4 radio buttons and uses scripting and CSS styles to show and hide the panels (all of which must be written to the HTML writer) appropriately.
Fortunately, Microsoft has already unofficially done this. See the Microsoft IE WebControls at http://www.asp.net/ControlGallery/default.aspx?Category=38&tabindex=2[^]. The MultiPage and TabStrip controls are what you would want.
BTW, this question would be more appropriate in the ASP.NET forum.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've got an annoying problem happening. I'm trying to design my user interface and I've got various controls which dock this way and that, and when i compile and run the app, while the window resizes smoothly, the controls that should be sizing to match the window size seem to trying to snap to an invisible grid as they go, which means the distance between the edge of the control and the border of the window keeps changing when the window is resized. It doesn't affect the functionality of course, but it's kinda ugly the way it happens and doesn't really look very elegant. Does anyone have a way around this? Note that I haven't even written any code yet, this is the very start of the app, and all i've done is added some controls and set their docking properties.
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
Hmm docking, what docking control are you using?
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
actually I made a mistake, I needed to set the integralHeight property of the child control to false. Confused the hell out of me until I noticed it sitting there in the properties box!
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
Mabey you should use
listView.Items.Clear();
Hope it helps
Thomas
|
|
|
|
|
I thought that you had found the solution, but no. I still get the same problem.
|
|
|
|
|
Doubtful. I use this all the time in a module I created for the application I architected at work. And calling ListView.Items.Clear clears only the items - not the columns as well like ListView.Clear would - which happens on many events in my application and all four views retain their behavior when doing so.
What else are you doing in your ListView ? Something else is garbling the list items.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I drop files onto the listView control, and the fullpath to each file is stored into a member ArrayList, the listView shows the file names and their associated icon which is extracted at runtime and placed into an imageList. The index's for the listView, ArrayList and imageList are all kept in sync.
Here's my code, first the InitializeComponent part for the listView:
this.listView1.AllowDrop = true;<br />
this.listView1.CheckBoxes = true;<br />
this.listView1.LabelWrap = false;<br />
this.listView1.LargeImageList = this.imageList1;<br />
this.listView1.Location = new System.Drawing.Point(24, 24);<br />
this.listView1.Name = "listView1";<br />
this.listView1.Size = new System.Drawing.Size(224, 224);<br />
this.listView1.SmallImageList = this.imageList1;<br />
this.listView1.TabIndex = 2;<br />
this.listView1.View = System.Windows.Forms.View.SmallIcon;<br />
this.listView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listView1_DragDrop);<br />
this.listView1.DragEnter += new System.Windows.Forms.DragEventHandler(this.listView1_DragEnter);
then the two events for Drag 'n' Drop:
private void listView1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)<br />
{<br />
if(e.Data.GetDataPresent(DataFormats.FileDrop))<br />
e.Effect = DragDropEffects.All;<br />
else<br />
e.Effect = DragDropEffects.None;<br />
}<br />
<br />
private void listView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)<br />
{<br />
string[] s = (string[]) e.Data.GetData(DataFormats.FileDrop, false);<br />
for(int i = 0; i < s.Length; i++)<br />
{<br />
<br />
if (!m_szFullFilePaths.Contains (s[i]))<br />
{<br />
<br />
int j = listView1.Items.Count;<br />
m_szFullFilePaths.Capacity = j+1;<br />
m_szFullFilePaths.Add (s[i]);<br />
Regex reg = new Regex (@"\\");<br />
string[] p = reg.Split (s[i]);<br />
listView1.Items.Add(p[p.Length - 1]);<br />
<br />
Icon ico = ExtractIcon.GetIcon (s[i],true, false);<br />
imageList1.Images.Add (ico);<br />
listView1.Items[j].ImageIndex = j;<br />
}<br />
}<br />
}
And finally the button click event for the "Clear" button, so that a fresh selection of files can be made:
private void btnClearLV_Click(object sender, System.EventArgs e)<br />
{<br />
listView1.Items.Clear ();<br />
m_szFullFilePaths.Clear ();<br />
m_szFullFilePaths.Capacity = 0;<br />
imageList1.Images.Clear ();<br />
}
Heres hoping someone can spot the problem, cause I can't.
|
|
|
|
|
One important module of our application that I wrote uses this concept - only in a much better way. Instead of storing the paths in a separate ArrayList , just use the ListViewItem.Tag property. It's there for any use you need. Second, design your icon/filetype lookup so that it caches the information. Why use SHGetFileInfo (well, that's what I use anyway) for files you have already discovered? In fact, the Windows shell does this very thing with a system image list that caches all the icon for file types. If you want, I could send you my implementation. It works on the same principals as what Windows Explorer does and is incredibly fast.
Also, quit messing with the ArrayList.Capacity . This is only used to determine when the capacity should be increased. The default behavior is to double the capacity (best deterministic algorithm) when the count is the same as ahte capacity.
The reason you're probably seeing this "sparsly" placed icons is because you have LabelWrap set to false . The ListView class (and the List View common control it encapsulates) uses fixed-width columns to display items. If an item's text go beyond that, the item's text is spanned however many columns is required to show the full text. This virtual column is not pushed to make room. You'll see this behavior in Windows Explorer as well, for like I mentioned, the ListView class encapsulates the List View common control that Windows Explorer uses.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the very helpful advice, I will put it into action latter. I am sure this will resolve the issue.
Thanks
|
|
|
|
|
I am populating a listView with items, and associating each item with an image in an imageList. The listView.View property is set as:
listView.View = View.SmallIcon;
When I add the initial set of items all is fine and the items are listed down the control, but when I use:
listView.Clear();
and re-populate the listView with the same method as before, the items are not listed down the control but are all over the place! Is there a bug or have I not set a property somewhere?
H E L P please
|
|
|
|
|
Hello,
I need to pass an array of strings to a COM object implemented in VB. The Interop interface wants a ref System.Array. How can I convert my String[] to this format in the fastest way possible?
Rickard
|
|
|
|
|
Its already an array:
string[] strs = "a d g v g r d".Split(' ');
Array a = strs;
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
Take a look at this post. I think it solves your problem.
|
|
|
|
|
I want to open a DAO Recordset
Database tempDB;
Recordset rstbl;
rstbl = tempDB.OpenRecordset("SELECT Name FROM myTblNames", DAO.RecordsetTypeEnum.dbOpenTable, DAO.RecordsetOptionEnum.dbReadOnly , DAO.LockTypeEnum.dbPessimistic );
Error is Invalid argument
|
|
|
|
|
Why are you using DAO? First of all, it was superceeded long ago by ADO. And since this is the C# forum, I can only assume you're using C#. So why aren't you using ADO.NET? It's a hell of a lot easier in .NET applications and has many benefits over plain ADO (like easy parameterized queries, data adapters, and more).
You can find more information about ADO.NET in the .NET Framework SDK: Accessing Data using ADO.NET[^]. There's also several technical articles in MSDN with examples: ADO.NET[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If taken a deep look into this hooking article: http://www.codeproject.com/csharp/NetWin32Hooks.asp?target=hook[^]. I had a problem with creating a global hook. The problem with creating a global hook, as some of you might know, is that the hook proc must reside in a seperate library so that it can be loading into all the running processes on the system. The author of the article above has testing just that with a .NET library and claims that it just doesn't work. I came up with a solution that I'm very close to finishing.
Basically I created a C++ library that implements all the hooking and exposes the functions so I can call them. For the .NET application to be able to get the events I resend them to the HWND that is passes when the hook is first installed. I can get the hook to work without a hitch if I call it from another C++ test application. However when I use P/Invoke to call the install function the hook isn't installed globally like expected but only hooks messages in the current thread. (In the C++ test application the hook works globally without a hitch) What am I doing wrong in this case? What is the right way to call the install function? If I can't get this to work I'll have to fall back to creating a C++ exe that will install the hook and initialize the HWND to resend events to.
|
|
|
|
|
Sounds like you're either P/Invoking the method wrong, or not passing the right parameter. Some code fragments (such as the P/Invoked method and the calling method) would help. Otherwise, you're not providing any information with which we can help you. Simply saying "it doesn't work" helps none.
Besides, you'd be better off asking this in the forum for that article, though asking here isn't exactly wrong (just that your question is specific to that article).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I know what are interfaces and what is the logic behind them, but I've never used them practically in any project.
Now I actually want to start incorporating them in my programms practically anc actually in a reasonable way.
I just want to know why should I use them instead of simply using classes? How are they useful when releasing new versions of our products?
Can you please provide me any link, where I can study and learn more about them? notice: practically
Regards!
|
|
|
|
|
I give you some point, you can't inherit from two class in C# but you can inherit from one class and as many as interface you waqnt. Is that enough reason forusing them in OOP world?
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
So, why interfaces are widely used in VC++, while it is possible to do multiple inheriting there?
|
|
|
|