|
I am looking for actual dictionary, with words and exlpanations, as you said.
One nation - underground
|
|
|
|
|
Hi all,
I am trying to show a "Image" in a DataGrid.
I have a new class I created that has 3 properties that are string and one that is of type image.
I create an Array of this class, and make the DataGrid source the Array.
But the image column comes up as a red cross in a white background, i.e. its not an image.
Can anyone give me some idea of best practice to show an image in a DataGrid please?
Regards
Tony
|
|
|
|
|
Hi Tony,
hope the following code works.
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
System.Web.UI.WebControls.Image anImagine ;
if(e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item )
{
anImagine = ((System.Web.UI.WebControls.Image)e.Item.Cells[1].Controls[1]); anImagine.ImageUrl="icons/" + e.Item.Cells[0].Text.ToString() + ".gif";
}
}
Keshav Kamat
India
|
|
|
|
|
Hi Keshav,
Many thanks for the reply I will give it a try.
Many thanks again
Tony
|
|
|
|
|
Can anyone please teach me how to add " into string, I was writing sql statement and need " in it. Thank you in advance.
|
|
|
|
|
string noQuotes = "no quotes";
string hasQuotes = "\"has quotes\"";
|
|
|
|
|
Thank you so much for your help
|
|
|
|
|
When you create strings special characters require an escape sequence. Any unicode character can be escaped by using \u and the unicode value, \uFEFF is one I am using because of some pdf issue. Newlines are \n tabs are \t a \ is \\.
File Not Found
|
|
|
|
|
Good evening everyone,
I have a feeling it's a silly question but how can you transfer a variable from one object to another without having to create another instance of these objects.. say I have two open forms and I want to pass a value entered in one form to the other one.
Thanks a million
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If you decalre a member as public static , you don't need an instance to access it.
As an example, if you declared a string in class like this:
public sealed class MyGlobal
{
public static string MyString = null;
}
You could access it from anywhare in your project like this:
MyGlobal.MyString = "hello";
MessageBox.Show( MainForm.MyString );
Hope this helps.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
IT WORKS!! Thanks a million Wayne
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If the variable is a reference type, you won't be creating a new instance, you will simply be passing a reference to the existing object. If the variable is a value type, you can pass it as a reference:
...
int someVarIWantToPass = 0;
form2.PassVarByRef(ref someVarIWantToPass);
...
-- modified at 18:47 Tuesday 20th March, 2007
|
|
|
|
|
Thank you Edmundisme
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I found a bit of code that allows you to add a webproxy to an HttpChannel
(http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/01/24/6050.aspx)
but even this approach would not work for TcpChannel. Is there some other way to implement a proxy functionality on a tcp channel?
|
|
|
|
|
Well, maybe you should look at custom sinks ... just an idea .. I'm not sure at all here
|
|
|
|
|
I've used sinks, but to my knowledge the last sink on the client side is the Transport Sink, and that cannot be customized or overridden.
|
|
|
|
|
Does anyone know how to concat on the displaymember of a combobox? I am trying to contatenate two fields together. Here is my code.
cboLocation.DataSource = ds;
cboLocation.DisplayMember = (string.Concat("Locations.LocationName", ' ', "Locations.LocationNo"));
cboLocation.ValueMember = "Locations.LocationNo";
When I did this, only the Locations.LocationNo shows. Need help.
|
|
|
|
|
what is your data source , if you are executing a query against a db , simply change your query to select Locations.LocationNo , (Location.LocationName + ' ' + Location.LocationNo) as LocationName from Locations
Taimur Khan
|
|
|
|
|
|
Thank you very much for reading and helping me.
I am now working with my degree final year project. I want to use a progress bar with style set to marquee to show a progress. However, I found that the progress bar does not scroll while I am running my project.
I have tested in a new project with only putting a progress bar with style marquee. It works smoothly. On the other hand, even if I new a form in my working project (the FYP one), and just putting a progress bar on it, it still cannot work. I also found that the appearance of the progress bar is flatten just like a disabled textbox.
May I know is there anything I have set it wrong?
I am new with C#. Thanks a lot for guiding me!
|
|
|
|
|
Post some sample of how you're trying to do it.
|
|
|
|
|
Thank you Zoltan. I guess that I did not include EnableVisualStyles() before newing the form.
I tried this and the progress bar did run.
I wonder why it does not need to enable visual style if I put a progess bar with marquee as style in a brand new project.
|
|
|
|
|
Because, by default, EnableVisualStyles is already turned on. Start a new Windows Forms project, then open the Program.cs file and you'll find it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much Dave~!
Seems that I have asked a stupid question.
|
|
|
|
|
I want 2 change a particular color in gif image...... for example want to change the hair color according to user choice how I do dat Can any buddy give any idea......set pixel is very sklow anything else..........
|
|
|
|