|
ty so much, now i can google it & get good info, thx again
|
|
|
|
|
You're welcome
Eslam Afifi
|
|
|
|
|
Hi,
I created the Gridview and has some boundfield columns to display(invisible or visible). I used a parameter to pass to display some particular fields. However, I need to search the column index before visible it. How am I going to do that?
protected void Page_Load(object sender, EventArgs e)
{
String selectcolumn = this.Request.QueryString["Selected"];
string[] columnID = commaStringToArray(selectcolumn);
// how to find the datafield of each column and visible them.
}
private string[] commaStringToArray(string strComma)
{
string [] strArray;
strArray = strComma.Split(new char[] {','});
return strArray;
}
In the web, they were all searching the headertext. But, I want to do the datafield.
|
|
|
|
|
|
I have a textbox with AutoCompleteSource set to CustomSource. AutoCompleteCustomSource has to be of type AutoCompleteStringCollection. During suggestions, .NET uses--I believe--sort on strings and gives suggestions. So if the string collection contains: 22, 26, 2162, 2052, 2002 and user types in 2 it will suggest 2002, 2052, 2162, 22, 26 because this is ascending order for strings. However, I want it to suggest in ascending order for integers so suggestion will be: 22, 26, 2002, 2052, 2162.
Even if the source for AutoCompleteCustomSource is sorted it get resorted based on string sort. Any ideas how I can show them in ascending order of integers?
|
|
|
|
|
Hello,
This will not be possible to implement. Reason being that the AutoCompleteSource only takes String
collection and would sort the colection only in string format.
Regards,
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
I have two date values
date1 = 23/11/2008 16:00
date2 = 30/11/2008 21:30
I want to know how many days in total which I can obtained by TimeWSpan
bu I also want to know if any hours and minutes are remaining out of the date difference?
how can I do it?
|
|
|
|
|
TotalDays
TotalHours
TotalMinutes
TotalSeconds
TotalMilliseconds
And
Days
Hours
Minutes
Seconds
Milliseconds
properties of a TimeSpan
The difference between TotalDays and Days is that they return, for example, 1.5 and 1 (the whole elapsed days) respectively.
Eslam Afifi
|
|
|
|
|
TimeSpan ts = (new TimeSpan(date2.Ticks)).Subtract(new TimeSpan(date1.Ticks));
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
but that will show the total hours between date1 and date2 when i just want the remaining hours after (date2 - date1)
|
|
|
|
|
jrahma wrote: but that will show the total hours between date1 and date2 when i just want the remaining hours after (date2 - date1)
No, the TotalHours property gives you the total hours. The Hours property gives you the remaining hours.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Mbah Dhaim wrote: TimeSpan ts = (new TimeSpan(date2.Ticks)).Subtract(new TimeSpan(date1.Ticks));
That was a complicated way of getting the time difference... Just do like this:
TimeSpan ts = date2 - date1;
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thanks
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
In SQL Server 2005 Express, I created a database the I right clicked to view the Properties then I went to Exended Properties. Now I have I have added a new Property called DBVersion and the value is 1.0
how can I read that property in my C# Windowx Application?
|
|
|
|
|
Hi,
I have a setup for MDI forms.
When I open an MDI client , i want the parent MDI opacity to be 50 % and back to 100 % when I close the client form.
My problem is that I am unable to access the Parent MDI form.
????????
Looking froward for your response.
Thank you!
Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
you can set parent form opacity to be 50% after show the child form, and add event FormClosed on your child form, in that event set back parent opacity to 100%.
but...
when you set parent form opacity this will also affect to your child forms.
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Dear Dhaim,
This is the plan i have in mind,
But Wht i am confused is
How can I access / change property of MID Parent while i am standing on MDI Chile.
Some sort of reference or something ??
Thx,
Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
Two solutions both from the parent not the child.
1. Subscribe to the child's FormClosing event (in the parent form after creating the instance).
2. Use the parent form's MdiChildActivate[^] event - this is fired every time a child is opened or closed.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
M. Nauman Yousuf wrote: But Wht i am confused is
How can I access / change property of MID Parent while i am standing on MDI Chile.
use this.Parent.Parent from your MdiChildForm
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Good Evening alL
I have an ASP.NET Front end that seaches the Dates in certain Ranges. here is my Data Layer.
public DataTable Get_Date_by_Month(String Username,String Datefrom, String Dateto)
{
con = new OleDbConnection(strcon);
DataTable Details = new DataTable();
da = new OleDbDataAdapter();
cmdselect = new OleDbCommand();
cmdselect.CommandTimeout = 0;
cmdselect.CommandText = "SELECT [Details].[Transportation],[Details].[HOUSING], [Details].[FEEDING], [Details].[UTILITIES], [Details].[INSURANCE],[Details].[TELECOMMUNICATION],[Details].[Entertainment],[Details].[FUEL],[Details].[CLOTHING],[Details].[EDUCATION],[Details].[Miscellaneous],[Details].[BASIC_INCOME], [Details].[OTHER_INCOME] FROM [Details] INNER JOIN USERS ON Details.[P_ID] = [USERS].[ID] Where Details.Username = ? And Details.[DATE] Between ? AND ? ";
cmdselect.CommandType = CommandType.Text;
cmdselect.Connection =con;
da.SelectCommand = cmdselect;
da.SelectCommand.Parameters.Add("[Username]", OleDbType.VarChar, 30).Value = Username;
da.SelectCommand.Parameters.Add("[DATE]",OleDbType.Date, 30).Value = Convert.ToDateTime(Datefrom).ToShortTimeString();
da.SelectCommand.Parameters.Add("[DATE]", OleDbType.Date, 30).Value = Convert.ToDateTime(Dateto).ToShortTimeString();
try
{
con.Open();
Details.Clear();
da.Fill(Details);
}
catch(OleDbException)
{
throw;
}
finally
{
con.Close();
}
return Details;
}
<pre>
but now if i try to Search between Valid Ranges, it Brings nothing to the DAtagrid. Am Using Access 2003
Thanks
<div class="ForumSig">Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http:
http:
vuyiswam@tshwane.gov.za
</div>
|
|
|
|
|
Vuyiswa Maseko wrote: da.SelectCommand.Parameters.Add("[DATE]",OleDbType.Date, 30).Value = Convert.ToDateTime(Datefrom).ToShortTimeString();
da.SelectCommand.Parameters.Add("[DATE]", OleDbType.Date, 30).Value = Convert.ToDateTime(Dateto).ToShortTimeString();
change those line to :
da.SelectCommand.Parameters.Add("[DATE]",OleDbType.Date, 30).Value = Convert.ToDateTime(Datefrom);
da.SelectCommand.Parameters.Add("[DATE]", OleDbType.Date, 30).Value = Convert.ToDateTime(Dateto);
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi
i have this code to create a new control (inherites from Panel) and when user over it, click mouse and drag, a new rectangle create and resize to fit with mouse position cordination:
public partial class Stage : Panel
{
int originX = 0;
int originY = 0;
bool dragging = false;
public Stage()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
}
protected override void OnMouseDown(MouseEventArgs e)
{
this.dragging = true;
this.originX = e.X;
this.originY = e.Y;
Graphics g = this.CreateGraphics();
g.DrawRectangle(new Pen(Brushes.Red, 4), this.originX, this.originY, this.originX, this.originY);
this.Invalidate();
base.OnMouseDown(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (this.dragging)
{
int posX = e.X;
int posY = e.Y;
Graphics g = this.CreateGraphics();
g.DrawRectangle(new Pen(Brushes.Red, 4), this.originX, this.originY, posX, posY);
this.Invalidate();
}
base.OnMouseMove(e);
}
protected override void OnMouseUp(MouseEventArgs e)
{
if (this.dragging)
this.dragging = false;
base.OnMouseUp(e);
}
}
but at runTime, it work so bad with flicker and when mouse button released. not any rectangle exist in Stage control.
can anyBody help me to find out how to create rectangle whith drag and drop correctly ?
thanks
|
|
|
|
|
use BufferedGraphics object
see this link[^]
or
link[^]
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Ok, first - don't draw using CreateGraphics. Override the OnPaint method, or register for the OnPaint Event.
Second, you can set double buffering on your form, which should reduce filcker (There should be a property on your form for this)
And the reason there is no rectangle when you've finished.. well, its because your no longer drawing any rectangle.
Rectangle rect = new Rectangle(0,0,0,0);
OnMouseDown(...)
{
this.dragging = true;
rect.X = e.X;
rect.Y = e.Y;
}
OnMouseUp(...)
{
this.dragging = false;
}
OnMouseMove(...)
{
if(this.dragging)
{
int width = e.X - this.rect.X;
int height = e.Y - this.rect.Y;
rect.Width = width;
rect.Height = height;
this.Invalidate();
}
}
OnPaint(...)
{
e.Graphics.DrawRectangle(myPen, rect);
}
Or something like that. You have to store the rectangle your creating, so that it can be drawn later on. It won't just stay there.
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hey guys.
How can we write
if (str.Length > 250) str = str.Substring(0, 250);
with ? operator ?
Thank you.
|
|
|
|
|