|
Its just selecting data from database and showing in a dropdownlist.
But dropdownlist was loaded, i have to show the data which was selected from database in dropdownlist as selected. its just showing user selected value from database in dropdownlist its used to update the user information....
karthik
|
|
|
|
|
I have no idea what you are talking about nor what your question is.
Obfuscation is for code, not for questions
only two letters away from being an asset
|
|
|
|
|
Hi,
I am using an itemplate coloumn in the datagrid. That template coloumn has a textbox, and i want to get the values from database to be assigned to that itemplate coloumn including other bounded coloumns. How is it possible.Plz help me.
yamini...
|
|
|
|
|
Text=<% Eval("ColumnName") %>
Look up databinding expressions
only two letters away from being an asset
|
|
|
|
|
Is there any way a Custom control which when placed on a form displays its current location on the form (in design time not at runtime)
So if it is placed on 0,0 then onthe control we have 0,0, drawn and if we move it to 50,50 it refreshes to 50,50
basically the component behaves differently according to its place on the form
Thanks for your time.
C++ where friends have access to your private members !
|
|
|
|
|
Hello,
You could override the OnLocationChanged method, like this:
protected override void OnLocationChanged(EventArgs e)
{
if(DesignMode)
{
}
base.OnLocationChanged (e);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks a lot
C++ where friends have access to your private members !
|
|
|
|
|
What you need to do is create a custom designer for your control. Since a bit of code is worth a thousand words, I will stop talking and just post a drop dead simple example.
<pre>using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms.Design;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace WindowsApplication1
{
[Designer(typeof(SomeControlDesigner))]
public class SomeControl : Control
{
public SomeControl()
{
this.Size = new Size(100, 25);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
using (LinearGradientBrush brsh = new LinearGradientBrush(this.ClientRectangle,
Color.CornflowerBlue, Color.White, LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(brsh, e.ClipRectangle);
}
}
}
public class SomeControlDesigner : ControlDesigner
{
protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe)
{
base.OnPaintAdornments(pe);
using(SolidBrush brsh = new SolidBrush(Color.Red))
{
pe.Graphics.DrawString(this.Control.Location.ToString(), this.Control.Font,
brsh, pe.ClipRectangle.Location);
}
}
}
}</pre> <br />
<br />
The OnPaint override is there just to make the point that this is a custom control. You'll also need to add a reference to System.Design.dll.
|
|
|
|
|
Excellent .... i am c++ coder and i am just loving C#
C++ where friends have access to your private members !
|
|
|
|
|
Very nice idea!
Got my "5"
All the best,
MArtin
|
|
|
|
|
what is Blob column and how to add in table
|
|
|
|
|
BLOB means Binary Large Object.
These columns store unprocessed binary data, typically files, that can be retrieved and manipulated like the other common datatypes. One sample use would be the storage of images into the database to be retrieved for a website to display.
Regards,
Satips.
|
|
|
|
|
This may not be a C# question but you can use SQL in C# so...
If you were to add a BLOB column to an existing table in SQL you would use:
ALTER TABLE {0} ADD COLUMN Image oleobject
After that, to add an image to that table you have to use a DataAdapter and store the image as a byte[] object to the Image field.
Brent
|
|
|
|
|
Hi,
I want to have a property grid to control properties of a class made by me.
I have searched the forum looking for some articles about it and the only thing i found that seemed to have interest was an article on how to show only some properties.
Assuming that i want to show all.
Isnt there a way of doing this directly?
For examle:
<br />
<br />
MyClass c = new MyClass();<br />
<br />
PropertyGrid.SelectedObject = c;<br />
This didnt work. What do i need more in order to see my attributes show in the property grid?
Thx,
Nuno
|
|
|
|
|
Yes you can show all you got to do is declare the attributes and description on the top of function which ever you want to expose and then you would be able to deal with it through your property grid
|
|
|
|
|
Humm, that was very vague.
Can you point me to a place where that is explain in detail?
At least, a simple example?
Thx
Nuno
|
|
|
|
|
<<<.csharpcorner.com/UploadFile/mgold/PropertyGridInCSharp11302005004139AM/PropertyGridInCSharp.aspx>>>>>>
|
|
|
|
|
Hi,
Thx for the reply but in the mean while i found a cool class here in codeproject which help me manipulating the property grid.
Thx,
Nuno
|
|
|
|
|
Hi Nuno,
I have compiled a list of PropertyGrid resources (see signature) and you will find a lot of informations along all these articles to work with the MS Grid.
|
|
|
|
|
Hello,
Does anybody know if there is ANY way to either get a reference to or just remove event handlers that you didn't declare yourself? (I am writing a plugin, but want to change the functionality of some buttons etc.) I've gathered that this is at least difficult if not impossible from other posts, but if anyone has a horrendous hack I'd like to hear it.
Alternatively, I wondered if it would be possible to identify an event handler through Reflection in order to remove it. Does anybody have any thoughts on this?
Thanks very much,
Keiron
|
|
|
|
|
Hi,
I have got this string "Test\Test1\Test2" and i want to extract Test2 string, how can i do that.
I am using C#.
Warm Regards,
Mushq
|
|
|
|
|
Hello,
You could work with the LastIndexOf(@"\") of the string class.
And then use the Remove(0, lastindex) method of the same class.
All the best,
Martin
|
|
|
|
|
If you need a powerful tool, C# has the Regex class [] [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
How save image to Microsoft Access Database in C#
|
|
|
|
|
first you have to add a Blob column to your table.
Then you read the picture into a Byte[] which
you can insert into your Blob column. There's
also an example in the sdk help which covers
that content.
Open the SDK Help choose the index tab insert BLOBs.
Regards,
Satips.
|
|
|
|