|
Hi all,
I am using datagrid in my c# windows application.I want to Delete(update) record when I clicked on datagrid item row.
To modify particular record how can I get ID field value of selected gridrow.
Please help me......
Regards,
Nagraj
|
|
|
|
|
Q1) Is anyone know that how to make a DataGrid's row pointer (almost left row) to invisible ?
Q2) How to select a row after use dataview.sort ?
Example, If I select (Highlight) a second row, then I sort it, the row selected will change to fourth row. I would like keep highlight on fourth row.
Thank
|
|
|
|
|
hi,
I have created a dynamic gridview with bound columns.When i tried adding radio buttons to that dynamic grid,the radio button is getting added outside the grid.I want to add radio buttons dynamically inside that grid using template field to retrieve the row's values to another page.
I have tried to retrieve values using select link button.but,i want to use radio button instead of SELECT option.
thank u for any help.
rita
|
|
|
|
|
Hi Rita,
I think you must be adding the radio button to some controls collection. am i right? If yes then i think that, the problem may be that you are adding the radio button to controls collection of the form on which you have the grid view. This might be one of the possibilities. I am not sure about it because you havent given much details. So if you can specify some code you are using it would be more easy.
Just check for the correct controls collection ( i hope this solves your problem)
Anant Y. Kulkarni
|
|
|
|
|
hi,
thanks for considering.
I want to add radio buttons dynamically to a dynamic gridview which i have already created using bound columns.
I want to use the radio button to select the row's values in the grid & pass value to another page(i.e,to a login page).I was able to pass values using java script,but couldn't find a way to add radio button dynamically to the dynamic grid.I could get values using a SELECT button to select row's value.
thank u.
if (!IsPostBack)
{
CommandField field = new CommandField();
field.ShowSelectButton = true;
field.HeaderText = "Select";
GridView1.Columns.Add(field);
}
rita
-- modified at 2:14 Monday 22nd May, 2006
|
|
|
|
|
Hi i am wondering if someone can help me with this. I have a listView control that i am taking the first row and adding it to an string array with 3 elements. I am wanting to know how i can pass the array with the values to a class so i can use it in a method
Thanks alot for your help!
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
just pass it in like anything else
<br />
string[] files = System.IO.Directory.GetFiles(@"c:\");<br />
writeFileList(files);<br />
<br />
void writeFileList(string[] names)<br />
{<br />
foreach(string name in names)<br />
{<br />
System.Console.WriteLine(name);<br />
}<br />
}<br />
<br />
<br />
hth
Al
|
|
|
|
|
I am trying to retrieve the last modified date of an external webpage. I have found numerous ways to do this in vb, java, etc... but not in C#.
Heres some of them:
VB - http://www.freevbcode.com/ShowCode.asp?ID=362
ASP (so basically the same thing) - http://www.webdeveloper.com/forum/archive/index.php/t-3706.html
I've tried using HTTPWebRequest and HTTPWebResponse, since HTTPWebResposne has a LastModified property, but this is when the response was last modified, not the page. So I'm stuck... Any help would be awesome
--Peter
|
|
|
|
|
You can call Response.GetResponseHeader("Last-Modified") to get the time, but then you have to parse it -- and there's about 3 standard time formats in HTTP. Luckily I wrote a parser for a web server[^] a while ago, so here it is:
static DateTime ParseHttpTime(string str)
{
DateTime dt;
try
{
dt = DateTime.ParseExact(str, httpDateTimeFormats, System.Globalization.DateTimeFormatInfo.InvariantInfo,
System.Globalization.DateTimeStyles.AllowWhiteSpaces | System.Globalization.DateTimeStyles.AdjustToUniversal);
}
catch(FormatException)
{
dt = DateTime.Parse(str, CultureInfo.InvariantCulture);
}
return dt;
}
The method can throw an ArgumentNullException if the input is null and a FormatException if the input isn't formatted properly.
Keep in mind this happens a lot... most servers don't seem to return a Last-Modified value these days.
|
|
|
|
|
So if the server doesen't return a Last-Modified value, as you said most servers don't these days, then is it still possible to retrieve the Last-Modified date of a page via some other means? Or am i just out of luck?
--Peter
|
|
|
|
|
I can't think of any other ways...
|
|
|
|
|
For some reason, every day or two, Visual Studio 2005 changes one instance of the word 'Component' to 'UserControl' (or to 'Form') in my .csproj file. I'm not sure why this happens. If I accept the change, within a few days, it gets changed back by Visual Studio.
Does anybody understand what is causing this problem? I can't seem to figure it out why this is happening. It just switches back and forth between 'Component' and 'UserControl'. It's kind of annoying because source control keeps wanting me to check out/save the changes to the file.
Thanks in advance for your help,
Curtis
|
|
|
|
|
Sounds like a bug... my guess is that it's because in WPF, custom controls are called UserControls. I personally think the name Component makes more sense, but bleh.
I think the MSDN Feedback Center[^] is where you want to look.
|
|
|
|
|
Hello,
I will be working with large data sets (> 4Gb) of binary data and was wondering if anyone was aware a method of reading an XML that I am thinking of embedding in the binary with XmlTextReader().
Thanks in advance for any help and have a good weekend
|
|
|
|
|
kevin-rf wrote: I will be working with large data sets (> 4Gb) of binary data
The person that designed that DB should be shot, repeatedly.
|
|
|
|
|
>> I will be working with large data sets (> 4Gb) of binary data
>The person that designed that DB should be shot, repeatedly.
Not a DB application, reading large real world data at high speeds (2 - 5 Mhz) for extended periods. The goal of embedding the XML is to tag some of the parameters used in the data acquisition setup. The thought is XML would be more flexible than a fixed binary header that is very "version" dependant. Data will later be crunched off line into chewable morsels.
The goal is to be able to pull the XML out and make some of the after the fact presentation/processing decisions based upon the XML parameters.
|
|
|
|
|
Ok, maybe I was bit harsh, I was reading XML and Dataset (the class).
IMO it would be easier just to define some C struct and fread it, XML has no real benefit for binary data.
|
|
|
|
|
Well you could Base64 encode data and shove it in an XML, but leppie's right, that wouldn't be a good idea, even with the benefit of extensibility. 4gb of data in XML can get huge.
Your best bet would probably be to sit down and think the file format over on the byte scale keeping in mind all the ways you might possibly need to use it, and then write a reader/writer for it.
|
|
|
|
|
A fair amount of the structuring of the file has been thought out. I am trying to evaluate how to store some of the nondescript data that does not directly effect readout of the binary but would be nice to include with the file. Stuff like the lab bench is green, So and So had to stand on there head spitting nickles to get the test to work, the nickle rate was 2.3 a second.
Embedding binary data in XML is not optimal for two reasons.
1. Encoding Binary Data increases the storage foot print.
2. Encoding the Data is slower than just streaming the data to a HardDrive.
The actual storage of the data will be done in unmanaged C++ for speed (Other side of the cube wall). My goal is to process the data after the fact in C#. The processing is not a CPU intensive, so C# will work nicely. One of the things I am trying to evaluate is, if an XML was tacked into the binary (The structure being defined will support inclusion) how do I get it back. The question is does anyone know of a way to pull the XML out of the binary and dump it into something such as XMLTextReader().
Is there an easy way to generate your XML in memory and then feed it to XMLReader() for parsing?
Thankyou for your feedback...
|
|
|
|
|
You could use XmlDocument. Save the document in the file with a particular encoding (UTF8 is good), note down its size, and then when you load it again, read those bytes and use System.Text.Encoding.Decode to get the xml string back, which you'd read using XmlDocument.Load().
By the way, C# can be as good or better performing than C++ (maybe not more if you consider the fact that C++ can do assembly), believe it or not, even for nitty gritty stuff like this.
Try using C# with pointers; that way you won't have to put the code in a separate assembly. Just make an array of sequential structs and drain all the data in.
|
|
|
|
|
Hello all,
I'm doing a project that does a lot of dynamic inspection of assemblies. Does anyone know of a quick, clean way to save a reference to an assembly within code? In other words, I need some way to persist the information required to locate an assembly so I can load it again later. It's easy enough when it is in the GAC, but what do I do when I want to allow the user to load an assembly from a configurable directory. Any thoughts?
Thanks,
Will
|
|
|
|
|
I think you can do System.IO.Path.GetDirectory(assembly.Location), and then determine the relative path of the file to the configurable directory. You'd probably have to write some code to walk through the subdirectories.
So if the directory is c:\someapp\assemblies and you have an assembly in c:\someapp\assemblies\mammals\dog.dll, the reference would be recorded as mammals\dog.dll.
Just an idea.
|
|
|
|
|
Ok, I've searched my MSDN documentation, but to no avail.
I seem to remember from a different language (whether from C++ or Java, I'm not sure, but I'm leaning toward Java) that, with a two-dimensional array, I could initialize one row at a time, kinda sorta like this:
<br />
someType[][] arrayName = new someType[#][#];<br />
arrayName[0] = new someType[#];<br />
(note syntax of second line!)
Is there a way, in C#, to handle one ROW of a two-dimensional array (as if it were a single-dimensional array)?
I'm aware that the [][] syntax isn't used in C# (I'm aware of the fact that C# instead uses commas in one set of []). But, you get what I'm saying, right?
-Daniel
Typing too fast fro my owngood
-- modified at 16:49 Friday 19th May, 2006
|
|
|
|
|
The [][] syntax is used in C# to create a jagged array (where each sub-array can have a different length). It sounds like that is what you should use.
Josh
|
|
|
|
|
Really? I'll try it again. Thanks!
-Daniel
Typing too fast fro my owngood
|
|
|
|