|
use Janus Grid ... checkout this site.. www.janusys.com
|
|
|
|
|
hi, i have datagrid filled from xml document, i want to make update, delete, add on the xml document through the datagrid, for example for the edit there will be a hyperlink located on the cloumn will direct me to another windows form and i will have the row data in controls on that windows form and i will make the edit from there, please i need a sample code for an urgent project
Thanks alot
Hamody
|
|
|
|
|
I tried the following code in my windows form which has a datagrid and i place it in the double click event of the datagridview
Form2 f = new Form2();
f.val = dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells[0].Value.ToString();
f.Show();
where val is a public variable declared in form2, i an haveing the first field as the primary key field so i referred it as cells[0].
and in the load event i placed the val to the textbox, now we got the key then using this value you can populate the form fields with the values from the xml file know.
I am not sure about your expectation.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
thnx,
I did n some way else, but noww, do u know whow to delete from xml file,
i deleted but i want to remove the node after deletion, for example if we have the following:
<city>
<name>Inida</City>
<time>5:55</time>
</city>
<city>
<name>Jordan</City>
<time>5:55</time>
</city>
and if i want to remove the city where name = India, i want to make it as:
<city>
<name>Jordan</City>
<time>5:55</time>
</city>
not as:
<city>
</city>
<city>
<name>Jordan</City>
<time>5:55</time>
</city>
thanks for helping me
-- modified at 3:21 Monday 11th June, 2007
Thanks alot
Hamody
|
|
|
|
|
Have you find the solution and can you post me the code how you have tried to populate and delete it
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
hello, realy no i havent got the solution up 2 this time, may u send me a code sample for adding a hyperlink to the datagat will redirect me to another windows form, and dnt worry after i will send u a full code sample
Thanks alot
Hamody
|
|
|
|
|
In .net 2005
This is a windows application
I have adapted the following code in order to populate the datagridview from xml file
DataSet ds = new DataSet();<br />
ds.ReadXml(@"D:\myappl\Student.xml", XmlReadMode.Auto);<br />
dataGridView1.DataSource = ds.Tables[0];
While the datagrid is clicked then it mead=ns the user is tring to edit the record so that i can get the selected row and the selected rows first cell contains the primary key so i am passing that to the form 2 (edit form) as follows in that the constructor of the form 2 takes one string argument which is the primary key of the selected field passed from the form1 as follwos
In form 1
private void dataGridView1_DoubleClick(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("" + dataGridView1.CurrentCellAddress.Y);<br />
MessageBox.Show(dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells[0].Value.ToString());<br />
Form2 f = new Form2(dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells[0].Value.ToString());<br />
f.val = dataGridView1.Rows[dataGridView1.CurrentCellAddress.Y].Cells[0].Value.ToString();<br />
f.Show();<br />
}
In form 2
public Form2(string value1)<br />
{<br />
InitializeComponent();<br />
textBox1.Text = value1;<br />
DataSet ds = new DataSet();<br />
ds.ReadXml(@"D:\myappl\Student.xml", XmlReadMode.Auto);<br />
ds.Tables[0].PrimaryKey = new DataColumn[] { ds.Tables[0].Columns[0] };<br />
DataRow dr = ds.Tables[0].Rows.Find(textBox1.Text);<br />
textBox2.Text =Convert.ToString( dr[1]);<br />
<br />
}<br />
if the Datarow and DataSet object is global and if you give the following code it will be deleted.
<br />
dr.delete();<br />
ds.WriteXML(...)<br />
Please tell me whether this is working or not but keeping a linklabel inside a datagrid is not possible if it is a web application then you can do that by keeing the hyper link field in the gridview control and it is possible to hide the primary key also
-- modified at 5:43 Monday 11th June, 2007
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi all,
I'm new to WPF and I'm trying to create a sheet music renderer. In order to be able to lay out notes on lines and in between lines, I am using grids to put my notes in rows and columns.
To acheive this, I would like to be able to have two grids with one superimposed on the other (this is easy to do). However, I would like to be able to position one grid to always be offset from the other grid by half the height of a row of the other grid (all rows are equally sized). I can achieve this somewhat by using a RenderTransform for a given scale, however the alignment changes when grid dynamically resizes to fit its container or when I scale transform the grid. The same goes by setting the margin. Instead I would like to somehow databind the y-offset of the one grid to half of the row height property of the other grid, but I can't figure out how to do so. This offset could be set by using a top margin or a render transform, but it must be dynamically calculated based on the current row height *0.5 of the other grid.
Any help or ideas would be much appreciated!
Thanks,
Tian
|
|
|
|
|
hi, I am using the C#.net 2.0 (2005)
what should i use for display the data...DatagridView or DataGrid...?
Please Help and also send the reason
Regards
Pankaj Joshi
|
|
|
|
|
DataGridView is easier to maintain but you cant format it in a good way.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
try MS-FlexGrid
|
|
|
|
|
Hi,
hard to say without knowing your requirements. Generally I would go for the DataGridView. Its a bit easier to use. Customization capabilities are nearly equal in both grids.
If you want to show a DataSet with different tables and relations between them than you should use the DataGrid.
Robert
|
|
|
|
|
The reason that many options exist is that different ones are better suited to different situations. Use the most lightweight object that lets you achieve your goal.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello All,
I have a desktop application which have the a MDI from and some childs forms.
when i cleck on MDI's menu one form is open like
Form1 frm=new Form1();
frm.show();
this is OK. But whenever user again click onto the menu again a form is displayed
I know this is because of
Form1 frm=new Form1();
But i want to show form only once i.e. If form open then no need to show it else show...
how I can do this..?
Regards
Pankaj Joshi
|
|
|
|
|
Hi,
there are many ways to do this, e.g. keeping a counter (or boolean flag).
The preferred one however is by simply disabling the menu item so the user sees he will
not be able to do it again.
|
|
|
|
|
Thx For Your Reply ,
I tried what you said ... but unable to got success because of the following regions.
1. Public Variables are not allowed in C#.
2. Every thing is object oriented that means you have to decalare a new instance of class variable before use it.
Say I have one MDI and two childs forms when I click on the menu and form1 is shows I use a class say class1
which public variable i assign as true say
public bool isForm1Shows=false;
When I use this in MDI I have to make a object of class1 to use isForm1Shows when I done this
isForm1Shows automatically goes false and creates problem. say after displaying the form1 i assign
this like
form1 frm= new form1();
isForm1Shows=true;
frm.show;
Then its ok but when i close the form1 what happned..? i have to write code on disposing method of the
form1 and again if i want to use Class1 here I have to create an object by keyword NEW then
isForm1Shows automatically goes to false. and this creates problem to me.
I think You got what i want to say
please Help me....
Regards
Pankaj Joshi
|
|
|
|
|
Hi,
your isForm1Shows should not be an instance (=non-static) member of Form1.
Make it either:
- an instance member of the class that creates the forms (your app itself?);
- a static member of the Form1 class (so it is shared by all Form1 instances,
and can be accessed even before the first Form1 instance exists).
You set it to true when you dco the frm.Show(); that is OK. Now you must set
it to false again when the form gets closed; this requires using one of
the events, e.g. the Closed event.
I dont see why you mention disposing the form; you can achieve what you want
without it...
If you are unfamiliar with static, public, Closed event, I strongly recommend
you buy a book on C# and work your way through it...
Good luck.
|
|
|
|
|
I assume it's not modal. In this case, it should be a member variable regardless, and you can check if it's visible before showing it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sir Sir Sir,
how i can check it is visible or not for checking visibility I have to create an
instance of that. And whenever I create New instance it create a new form
Please help
Regards
Pankaj Joshi
|
|
|
|
|
Hi, why not loop through the child forms. What i do is set the form to max, but you could check for your form.name or whatever property you would like to juse
Form[] charr= this.MdiChildren; <br />
<br />
foreach (Form chform in charr) <br />
chform.WindowState=FormWindowState.Maximized;
Kind regards,
marcel vreuls
http://www.marcelvreuls.com
|
|
|
|
|
Thx For Reply,
But i can't get this method yet..
and what about the forms which have maximize propety false please
give me a simple solution.
Regards
Pankaj Joshi
|
|
|
|
|
Is it possible to see from web whether or not the EXE is installed on a
machine? for example, i'd like to check if gtalk or realoneplayer is installed in localmachine and if it is not installed ,how can find from web.at that time i want to give alert message or give the downloaded page.Is it is possible bc..Plz any one help me.
Thanks.
Regards,
justin
|
|
|
|
|
Yes.
You might consider attempting to read the default value from the
registry at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App
Paths\realoneplayer.exe.
Hope this will help you.
ANd you can alert the Message using Javascript.
Regards,
Satips.
|
|
|
|
|
Thanks for ur reply..
I cant able to read the register key value from web.Bcz security exception occur.
regards,
justin
|
|
|
|
|