|
thanks 
|
|
|
|
|
Im trying to support labeledit in my ListView control but
i am stuck on getting the ListViewItem object edited.
In the EventArg to EndLabelEdit there is an Item member
telling which index was edited but how do i get the ListViewItem
from the index?
listView1.Items returns the ListViewItemCollection and according
to the help there should be an Item property there but it
is not there...
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
|
Surely there must be some way of getting the ListViewItem by index without using SendMessage() ?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
If I understand your problem correctly then a simple
ListViewItem theItem = listView1.Items[e.Item]; would be the answer (with e being the LabelEditEventArgs ).
Can it be so simple?
mav
|
|
|
|
|
Hmmm..i was so sure that was the first thing i did try, it is that simple....i better start sleeping at nights.
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
i have bound a dataset to a datagrid ...
now ..
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
temp = e.Start.Date;
DateTime dt;
dataGridView1.Update();
foreach (DataGridViewRow dr in dataGridView1.Rows)
{
dt = System.Convert.ToDateTime(dr.Cells[2].Value);
// textBox3.Text = dr.Cells[2].FormattedValue.ToString();
if (dr.Cells[2].Value != null && dt.Date.Month != temp.Month)
// dataGridView1.Rows.Remove(dr);
DataTable1DataConnector.RemoveCurrent();
}
}
what im trying to do here is ... i have a monthcalender object on the form .. and when i change the month ..i want to re-populate the datagridview such that it displays only entries of that month ...
how do i do this ?
here it does del the entries whihc are not of that month .. but doest repopulate again !
|
|
|
|
|
Bind against a DataView instead. You can set the RowFilter which may or may not update the DataSet automatically. If it doesn't, one way is to assign null to the DataGrid and then assign the DataView back. You could also get the CurrencyManager from the BindingContext and call CurrencyManager.Refresh . That would be the preferred method.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello..
Plz can anyone help me how to prevent adding new line to the dataGrid??
Thanks..
Baraa
|
|
|
|
|
You mean setting ReadOnly property.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
No, the user can modify an existing line but he cant add new line..
This is what I mean..
Thanks..
bhshs
|
|
|
|
|
Bind against a DataView instead of a DataSet or DataTable . You can easily create a DataView from a DataTable (just pass the DataTable to the DataView constructor) and then set DataView.AllowNew to false . Set the DataView as the DataGrid.DataSource .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I am doing an application in c# where i have 2 picture boxes.
In the first picture box i open a bitmap.
Then ,when i select a rectangle in this bitmap,the part of the image within the boundaries of the rectangle opens in the second picture box.
I cant actually open the part of the image (within the rectangle) as a separate image in the second picture box.
I used :
g=pictureBox2.CreateGraphics();
ImageAttributes remapAttributes;
ColorMap redToBlue;
redToBlue.oldColor = Color(255, 255, 0, 0);
redToBlue.newColor = Color(255, 0, 0, 255);
remapAttributes.SetRemapTable(1,&redToBlue);
g. DrawImage (globalImage,rect,zoomStart.X,zoomStart.Y,width,height,UnitPixel,remapAttributes,null,null);
but this code is giving many errors although its a copy from the one in the msdn.
please help
|
|
|
|
|
It seems as if you've copied the code from a C++ article, so this cannot work.
Graphics g=pictureBox2.CreateGraphics();
ImageAttributes remapAttributes = new ImageAttributes();
ColorMap redToBlue = new ColorMap();
redToBlue.OldColor = Color.FromArgb(255, 255, 0, 0);
redToBlue.NewColor = Color.FromArgb(255, 0, 0, 255);
remapAttributes.SetRemapTable(new ColorMap[] { redToBlue });
g.DrawImage(pictureBox1.Image,
pictureBox1.ClientRectangle,
0,
0,
pictureBox1.Width,
pictureBox1.Height,
GraphicsUnit.Pixel,
remapAttributes);
This is at least compilable if you have a pictureBox1 and pictureBox2 (and use using System.Drawing.Imaging; at the beginning of your code).
mav
|
|
|
|
|
Hey,
has anybody tried using global hooks with WH_JOURNALRECORD or WH_JOURNALPLAYBACK in c#?
I used the class found at http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/ and it works fine with WH_MOUSE or WH_KEYBOARD (i have modified the code to make system-wide and it works fine).
However, once i set the hook to WH_JOURNALRECORD or WH_JOURNALPLAYBACK the system stops responding (but the mouse still works) and the system only un-freezes when i pres CTRL+ALT+DEL...i also noticed that the journal callback procedure is never called in WH_JOURNALRECORD but it IS called after WH_JOURNALPLAYBACK but ONLY when i press CTRL+ALT+DEL...anybody knows anything about this?
Thanks
|
|
|
|
|
hello guys i have a critical problem.what i want to do
"I have a webform and which has a help button.when i press the help button
the web form must divide in to 2 piece.like 3/4 space for previous content
and 1/4 space for help content.this should exactly look like the help features
in microsoft word. "
so how can i do this and what are the methods that i can use.
|
|
|
|
|
try this:
your web page(test.htm):
<html>
<head>
<title>WebForm1</title>
<script>
function ShowHelp()
{
var height = window.screen.height;
var width = window.screen.width;
var aWidth = width * 3 / 4;
var bWidth = width / 4;
window.moveTo(0,0);
window.resizeTo(aWidth,height);
window.open("Help.htm","Help","top=0,left=" + aWidth + ",height=" + height + ",width=" + bWidth + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}
</script>
</head>
<body>
<a href="javascript:ShowHelp();">Help</a>
</body>
</html>
your help page(help.htm):
<HTML>
<HEAD>
<title>Help</title>
<script>
function CloseHelp()
{
var height = window.screen.height;
var width = window.screen.width;
window.opener.moveTo(0,0);
window.opener.resizeTo(width,height);
}
</script>
</HEAD>
<body onunload="javascript:CloseHelp();">
</body>
</HTML>
|
|
|
|
|
Hi duaneye2003,
Your code is working fine... but(o oh) when we refresh the help.htm the body onunload function is getting fired which changes the opener page to its original(full screen) size but we don't want this.
So if possible can u tell me how to stop the onunload function while refreshing the help page.
I hope you are getting me.
|
|
|
|
|
Maybe this can solve this problem, but i don't think this is a good method.
change help.htm to this:
<HTML>
<head>
<title>Help</title>
<script>
function CloseHelp()
{
var height = window.screen.height;
var width = window.screen.width;
window.opener.moveTo(0,0);
window.opener.resizeTo(width,height);
}
function ResizeOpener()
{
var height = window.screen.height;
var width = window.screen.width;
var aWidth = width * 3 / 4;
var bWidth = width / 4;
window.opener.moveTo(0,0);
window.opener.resizeTo(aWidth,height);
}
</script>
</head>
<body onunload="javascript:CloseHelp();" onload="javascript:ResizeOpener();">
</body>
</HTML>
if you get a good idea, please tell me.
|
|
|
|
|
after click the help,help.htm is not loading.give me a solution.
|
|
|
|
|
I think u have to add ":" while calling the javascript function like this
body onunload="javascriptCloseHelp();">
change this to
body onunload="javascript:CloseHelp();">
Similarly change others also
Hope now it'll run.
|
|
|
|
|
ok guys thanx a lot about your feedback.but the problem is i don't want seperate web form for help.i just want to do it on the same web.aspx file.
so how can i do that.
|
|
|
|
|
|
I need to following filter in a dataview:
EventTime > '7:00' AND EventTime < '12:00'
But it simply doesn't work. The result is an empty grid showing up.
All properties have been linked correctly. So it should be something with this filter. Can anyone tell me how to use time as your RowFilter?
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
Hi,
How can i develop a application which can execute once and the executive file would be removed from device. Like: After program show a message, this executive file is removed. I got a straight way that after the application executes, deleting this application file. But how? Running program couldn't delete itself. Any suggestion is welcome. Thanks!
Regards, ginee
|
|
|
|