|
Hi all,
I have added linkbutton to the datagrid in the template column.i have to display particular field of datasource to the lnkbutton text.My code is like this
this is a class file
public class DataGridTempla :System.Web.UI.Page,ITemplate
{
ListItemType templateType;
string columnName;
public DataGridTempla( ListItemType type,string colname)
{
templateType = type;
columnName = colname;
}
public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
LinkButton lb = new LinkButton();
lb.Click+=new EventHandler(lb_Click);
case ListItemType.Item:
lc.Text=columnName;
lc.Text = "Select " + columnName;
lb.CommandName = "EditButton";
lb.Text= "" + columnName + "";
//container.Controls.Add(chkb);
container.Controls.Add(lb);
container.Controls.Add(lc);
}
this is my webform coding
TemplateColumn tc=new TemplateColumn();
tc.ItemTemplate=new DataGridTempla(ListItemType.Item,"BrandId" );
BoundColumn bc=new BoundColumn();
bc.DataField="Brand_Name";
DataGrid1.Columns.AddAt(0,tc);
DataGrid1.Columns.AddAt(1,bc);
DataGrid1.DataBind();
please try this.
sivamyneni
|
|
|
|
|
Siva Myneni wrote: please try this.
Ok, I tried it, now what?
First, as this is related to ASP.NET you might get a better response by posting it to that forum.
Second, try using a template in the the aspx rather creating it in the code-behind
only two letters away from being an asset
|
|
|
|
|
Hi,
In my solution I have a project for the application and the installer project. The installer builds "Applicationname install.msi", and everything works great.
What I would like to do is this:
Simple solution:
Get the installer project to build "applicationname install <versionnumber> <debug|release>.msi" instead of just "applicationname install.msi" which I then have to rename manully afterwards. Is this possible ?
Optimal solution:
Checking files into subversion creates an assemblyinfo.cs with the number 1.0.0.<subversion_revision> or something. I know how to do this. I could also update the "installerprojectfile.vdproj" to reflect this, although this would change the status of the .vdproj file subversion-wise... ah well.. But that would allow me to automatically update the version in the installer - and if I could get that version reflected in the installer filename I would be home safe
Anyway - has anybody a clue regarding the simple solution ? Is it possible at all in the build-in deployment project ?
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
You can change the name by going to the properties of the setup project and changing the Output file name.
You can setup a postbuild event in the insall project to update the filename with version number.
only two letters away from being an asset
|
|
|
|
|
aha... thanks for the answer, Mark.
I have to select the install project and then the properties tab in order to get the list of project properties (right clicking and selecting properties brings up a dialog with nothing relevant). In the list of project properties I can specify a post-build event, which brings up a dialog with these three macros:
$(BuiltOuputPath)
$(Configuration)
$(ProjectDir)
which are, in turn,
c:\...\folder\debug\applicationname.msi
Debug
c:\...\folder\
So I could write something like
rename $(BuiltOuputPath) $(ProjectDir)$(Configuration)\appliactionname <version>.msi
which would expand to
rename c:\...\folder\debug\applicationname.msi c:\...\folder\debug\applicationname <version>.msi
but how do I retrieve the version number here ? If I have to change the post build macro each time I change version I might as well just change the filename manually
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
You have to get a little more creative, think outside teh macro box.
Write a script(WSH) or simple console app that can be called from the post build event which will read the file for version infor and update the msi file name.
only two letters away from being an asset
|
|
|
|
|
I see.. No built in support for this kind of advanced scheme ) Strange that you can't get project properties like version in the macro.
However, no matter how much out of the macro box I think, I still cant see how I can retrieve the project version number from the msi file. Got any ideas for that ?
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
I use singleton pattern to connect to a database and sql sentences , but the string connections read one time from an xml file when i do new SingletonClass().
Is this safe?? cos the string connection that i read, is stored on a private attributte of the singleton class.
and the next times that i want to access to database i dont read the xml with the parameters to the string connection,i use the string var with the string connections.
thanks
God make a perfect team, the rest have foreigners, Athletic Club Bilbao
|
|
|
|
|
Legolas.Bilbao wrote: Is this safe??
Are you worried about the connection string being stored in an xml file on the disk ?
|
|
|
|
|
worried about string connection had stored on memory its a problem or not? maybe its a paranoic question
Dios creo un equipo perfecto a los demas los lleno de extranjeros
|
|
|
|
|
in my application I want to try delete an image file.. but at every attempt I get an
[System.IO.IOException] {"The process cannot access the file '..\\addAll.png' because it is being used by another process."}
I am sure that this file is not in use because I just dispose the Image object using this file with :
((PictureBox)flowLayoutPanelThumbs.Controls[0]).Image.Dispose();
flowLayoutPanelThumbs.Controls.RemoveAt(1)İ
1-Why occurs this cannot access bla bla bla error and how can I avoid this?
2-How can I find the process using this file
I will REALLY appreciate any help..
thanks and best regards
.:: Something is Wrong ::.
|
|
|
|
|
Use this tool: Process Explorer [^] to find which process is holding the handle to the mentioned file.
|
|
|
|
|
As suhredayan suggested, first check if some other process is holding open a handle to the file. If it's your process, how are you creating the Image object? I vaguely remember there being a bug in the framework that caused this problem if the Image instance is created using Image.FromFile . If you're using Image.FromFile, you could try Image.FromStream instead.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
If you load an image yourself, then the file handle stays open until you call dispose. If you've called dispose, you should be able to save it. The answer often is if you use FromFile, to make a copy, keep the copy and dispose of the original right away.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the answers.. As you guessed the FileHandle stays open so I taked a copy and Dispose the orignal one..
rule 1 : always use "using(.....){ }" when you are working with object that needs to be closed by hand
Thanks a lot..
.:: Something is Wrong ::.
|
|
|
|
|
1. Can I make my own skin for C#.net app as i see GUI of professional app?
2. How to make it? What function or class?
3. Could u give me some example ?
AAA
|
|
|
|
|
|
I'll try to be brief...
Problem:
Using standard (de)serialization I'm saving the contents of a multiline textbox into a few different string variables (depending on which option the user has selected), which are then being saved into an XML document.
Upon reading the values from the XML files and displaying them into the textbox the actual linebreaks are being replaced by a square (which is actually char 13). This is making no sense to me. The textboxes are set to multiline, and if I use a rich textbox control instead of a standard textbox control it works fine.
If I take the square character and paste it into notepad or the VS IDE it creates an actual line break.
Why is this happening and how can I fix it? I'm stumped.
|
|
|
|
|
In the string being displayed, replace \n with \r\n and it should work as you expect (or it might be \n\r I can't remember which!)
|
|
|
|
|
Some systems use a single character (10) as line break, while DOS/Windows uses two characters (13, 10).
You can fix any "funky" line breaks with:
theString = Regex.Replace(theString, @"\r?\n", Environment.NewLine);
This code works regardless of the type of linebreak the current system is using, and it doesn't mess up line breaks in the string that already are correct.
-- modified at 3:18 Thursday 24th August, 2006
Made a correction about what characters are used, and changed the regular expression pattern accordingly.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks. This didn't work directly, but after making it search for just "\n" and replace it with an Env.NewLine that did work.
Strange...
|
|
|
|
|
Right. The square characters that you have is not the carrage return (char 13), but line feed (char 10). I have corrected the code that I posted earlier.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
I have a program that generates some HTML and then needs to automatically print it. This automatic printing occurs within a separate thread (timer) and for the life of me, I just can't get it working.
After a couple of days Googling around, I found a couple of things:
1) Attempting to do it calling IE (or the equivalent DLLs) isn't an option since it'll always pop up a print dialog box and there's nothing that can be done about that.
2) webBrowser1.Print() should work, but doesn't. It doesn't call an exception, it doesn't have any problems, but it also doesn't print. I'm assuming it's related to the fact that this is all in a separate thread from the timer.
3) If I attempt to be "messy" and just call a complete new thread that creates the webbrowser object, loads the HTML and print it, it gives an exception complaining it's not STA, even though I did set it that way.
So basically, I'm fairly stuck at this point. Here's the code I've tried so far minus the messy one, since that's definitely barking up the wrong tree I think. (note that the html is both in my webbrowser object or in the file - I'd love to not have to use the webbrowser object if I can get away with it)
<br />
<br />
<br />
<br />
<br />
Ben de Waal
|
|
|
|
|
To clarify further, this code:
YttriumOxide wrote: /* //This doesn't work - maybe because of the thread?
*
* webBrowser1.Navigate(szTempFolder + @"\Temp\Body.html");
* webBrowser1.Print();
*/
DOES succesfully do the webBrowser1.Navigate, but NOT the webBrowser1.Print - which is extremely confusing in my books... Why does Navigate work inside a seperate thread, but not Print?
Ben de Waal
|
|
|
|
|
Hello all,
I wonder if any of you have found/written a free Ribbon Control (the office 2007 style)?
I found some ribbon controls while googling but none of them are free (not even for non-commercial use).
Regards,
Pawel
|
|
|
|