|
This is answer is without having VS in front of me and I didn't program ASP.net for some months so my memory of the terminology is a bit rusty.
Turn your datagrid column into <asp:templatecolumn> , then add an
<itemtemplate></itemtemplate> within the itemtemplate you can add your <ASP:DropDownList> , make sure to add the right events to the dropdownlist. If you want to fill the dropdownlist on runtime, you have to hook up to the itemdatabind (or something like that) event, there every row of the datagrid is being filled.
-- modified at 8:44 Wednesday 21st June, 2006
|
|
|
|
|
Thanks for that suggestion. It works for ASP.NET.
Am developing a windows application and using DataGrid available for winforms.
Is there a why how to do it in winform datagrid control??
Regards
Kais
|
|
|
|
|
I overlooked the "windows" part in the title.
There is a way, but since I don't have VS in front of me, its kind of hard for me to help you. I believe there is already a .NET object made by somebody that does this. I would use reflector and check how the other columns (checkbox, textbox etc) are made, and then in the same way create a dropdownlist column.
|
|
|
|
|
Searching for DataGrid ComboBox[^] gives several results. I think one of those should match your needs.
|
|
|
|
|
Hi.
My application opens xml reports from command line, which generated and executed by another C# programm. So I get file from "main args[]" to open. How to make my application to open new document if it is already launched and new commandline command with arguments executed?
|
|
|
|
|
When your application opens, indicate it somewhere, like a creating a temporary file, with a well-known name, containing the process id of the currently running instance of your program.
When you execute the command line, your program checks for the presence of the file. If it exists adn the process id it contains is still running, use some interprocess communication to tell it to open the new file, then exit from the new command line.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
hi all,
i think everybody in this forum are very busy their jobs.Yes,i have a
problem in opening a pdf file using hyperlink or linkbutton or anything
in .NET.Please tell me some control name by which i can open the PDF file or
Please tell me the steps to be followed to open it.I have delivery of my
project it is very urgent.Please give me solution as early as possible.
Thnak you all in advance.
bye.......
K.vamsee Krishna
|
|
|
|
|
Aspose.PDF[^] has a viewer I think.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
On event LinkClicked use this function : Process.Start("myfile.pdf")
The file is opened with default pdf reader.
|
|
|
|
|
i have a document in crystal report and i want to save that report as pdf, in windows application.. could anybody help me...
|
|
|
|
|
hi
try this
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
ReportDocument pdfReport = new ReportDocument();
pdfReport.Load(myReportFileName);
pdfReport.SetDataSource(myDataSet);
pdfReport.Refresh();
MemoryStream ms = (MemoryStream)pdfReport.ExportToStream(ExportFormatType.PortableDocFormat);
// Write the MemoryStream (i.e. ms) to file
regards
joe
|
|
|
|
|
Don't forget to call Dispose() on the ReportDocument object too.
|
|
|
|
|
how i can make connection between windows form and sql server through code?
|
|
|
|
|
|
hi all,
i am trying to load a page in a webbrowser.
how can i be sure that the page i am trying to open is completely loaded ?
then again i want to refresh that page for couple of times. (but it must be loaded completely before each refresh)
how can i check this ?
help please.
thanks in advance,
bye.
|
|
|
|
|
Monitor the ProgressChanged event, the DocumentCompleted event isn't that reliable I've found, sometimes kicks in too early. Once you've decided the whole page has loaded then you can refresh it and start monitoring again.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Hi to all,
How/where to add libraries req. for C# project in Visual Studio 2005 framework.
Best Regards & Thanks,
Aniket Salunkhe
|
|
|
|
|
In the solution explorer you can right click on the name of the project and click "Add Reference". I believe that you can also go to the Project item in the menu and select "Add Reference"/
|
|
|
|
|
I am making a form that will will Generate a report. It will display the report from the reporting services.
From that form, I have a preview and print buttons. Preview will display the report.
and print will print the report. Printing of reports would be possible even if the report isn't displayed yet.
How will i print the report though it hasn't beens shown yet?
What could be my possible code for it?
|
|
|
|
|
Hi I've never really understood the use in this peice of code, ive been told its good practice/programming to use it and its been mentioned it had somthing to do with security but personaly i cannot see why.
<br />
private int x;<br />
public int X()<br />
{<br />
get {x}<br />
set {x = value;}<br />
}<br />
(the code might be slightly wrong doing this on the fly)
whats the use in it though surly unless your only using one of the get or the set you might as well just use a public variable that way u decrease on the code thats needed to be written, compiled and read.
any comments would be apreciated
-- modified at 6:16 Wednesday 21st June, 2006
|
|
|
|
|
Yes it is definately good practice. There is a slight mistake in it, it should be
get
{
return x;
}
And no () parentheses after X.
X is called the property of x and the reason it is good practice is because in the GET and SET section you can write code to perform any operation you want. For example, you might have a boolean variable (call it 'ready') in your class and you would only allow users to retrieve the value of x if 'ready' is true. So you could do the following:
get
{
if (ready) return x;
else return 0;
}
The same thing can be applied to the SET section, where you could for instance only allow writing of a value if 'ready' is true:
set
{
if (ready) x = value;
else x=0;
}
Now, if a variable only has a get property, it's said to be read-only. Obvsiously, since you cannot set its value to anything.
I hope this helps a bit.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
i realised that you could enter other code into the get and set but i hadn't thought of using it in that way, which makes alot of scence.
but that was well explained thx
so as far as good practice gose its good to use it on a normal variable without any aditional code just so if somone comes along in the futre they dont have to adjust a ton of code?
|
|
|
|
|
yes, it is a good idea to always have your class variables as protected or private and expose them to the user by mean of properties.
Another common practice is to have the propery name the same as the variable name but with a capitalized first letter. i.e. roleName and RoleName.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
It is just usefull when u want to trace a code where u can use value of 'x' and change value of 'x'. And it is more usefull for large project.
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
There are already good answers to your question, but I'll give you the simple answer...
One of the corner stones of object oriented programming is encapsulation. Which means hiding implementation details from the user. When you expose a field you are allowing the user to set that field to anything they wish. When you encapsulate that field with a property, you allow the class the ability to validate data that the user tries to set to that property/field.
When designing a class, it's important to state in some fashion what the expected behaviour of the class is within a finite range of inputs. It's up to the class to determine what valid inputs are so that it can guarantee valid behaviour. Properties allow the class to take input from the user of the class and verify that it can guarantee correct behaviour with the data provided.
Granted, most people just use the most basic functionality for a property, which is to just return or set the field. But when clients of the class are using the property, you can easily change the property to do data checking later without changing how the clients use the class.
Hope that helps.
Visit BoneSoft.com
|
|
|
|