|
no. I am trying to write a replacment windows shell and I have got to the stage where I need to replicate the system tray. The point where notify icons are placed. Sorry my orrigional post obviously wasnt verry clear on that.
Tanks anyway
daniel
|
|
|
|
|
Yeah, so write an implementation of NotifyIcon for your shell as I think the previous poster intended Basically, the interface for NotifyIcon tells you exactly which functionality is needed and how it is implemented. Basically you can use the same interface and supply a new implementation for it specific to your shell.
Edit:
On the implementation, basically what you need is a toolbar which can display icons, has customized menu's for each icon, has tooltips, and perhaps one or two more features. Here too, the NotifyIcon class gives great amounts of information how to implement each feature.
|
|
|
|
|
I am trying to implement a simply task that appears to be amazingly hard to accomplish in .Net: Sorting a column in a datasource bound control (e.g. DataGridView), not based on the underlying values (i.e. simple string comparison on the values) but on some custom rule that I want to define.
I have a DataGridView that is bound to a Bindingsource which in turn is (via Dataview, .Net internal stuff...) bound to a Datatable. This is plain vanilla stuff, out of the box. If I was happy with the default sort behavior, i.e. sorting columns by the values in DataTable, everything would be easy, even automatic.
However, some of the contents in the Datatable is not in a user-friendly format, so it must be formatted for display in the datagridview (e.g. by overriding the CellFormatting event). If I now sort the control by that column, the rows will be sorted by the underlying values, and not by the displayed text, which is bad.
I cannot use the Sort() function nor the IComparer overwrite of the DataGridView since I am working in databound mode. How in the world then can I intercept the sorting mechanism and tell the DataGridView how to sort this column properly?
It strikes me as odd that the standard data source - binding source - control model in .Net appears to have no provision at all for custom sorting! What is even odder is that a primary reason for the whole concept of a BindingSource is just sorting and filtering!
There must be an easier way than writing 1000s of lines of code to create my own DataView or IBindingList derived class that will allow this kind of customization, as recommended in various articles. This seems such a common scenario that I can't believe there is a more elegant way...
|
|
|
|
|
AFAIK you must apply your (custom) sort on the underlying data structure, not the DGV itself. So set the DGV to programmatic sorting, handle the cell click event (checking for row<0 and getting the column index), and sort your DataTable or whatever is underneath the DGV.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
I'm not sure I understand the difference between these two events (Form.Deactivate and Form.Leave). Could someone enlighten me please?
|
|
|
|
|
Occurs when the form loses focus and is no longer the active form. (When the title-bar of the form changes from blue to gray)
Occurs when the input focus leaves the control. (When the cursor focusses another control/window)
Bastard Programmer from Hell
|
|
|
|
|
Alright thanks, but isn't that pretty much the same thing? I'm talking specifically about a form, not just any control. So "when the cursor focusses another form", isn't that precisely when the form's title-bar changes from blue to grey?
|
|
|
|
|
Yup. The active form is usually the one with input-focus (fails sometime when apps modify the z-order). Hence, if the input-focus moves to a different form, the new form will should be activated. Even if the validation would fail and the focus retained - the active form would be the one with focus.
Bastard Programmer from Hell
|
|
|
|
|
OK, thanks. So, am I correct that, as regards Forms, there is no difference between Form.Deactivate and Form.Leave?
|
|
|
|
|
Well, there is, otherwise one of both would be redundant. Imagine you open a form, has focus. Now I click once on a tray-icon. Just tried it, and the form raises the Deactivate event, not the Leave event; the form still has the input-focus (for your app, and will continue there when it's activated again).
Bastard Programmer from Hell
|
|
|
|
|
No, it's not. It's entirely possible to have a form deactived, but the focus never really leaves the confines of the form. I know, it's rare, but it happens...
It's also possible to have the focus leave the form, but never deactivate the form by clicking on someone outside of it.
What you do with those events is up to you.
|
|
|
|
|
Hay Guys,
I'm working on one live project which is web based application. And We Are Using Business Logic Using Multiple Class & Fatch The Record In Front End From Back-End DB2. Now I Need To display Multiple Records.
In One Gridview, I Need To To Display One More Gridview Control By MasterGrid Reff. Through Identification By Unique Key. Using Business Logic(Classes)
Thank You For Consideration.
|
|
|
|
|
Did the answer in the thread below not help, or did I misinterpret your question?
Bastard Programmer from Hell
|
|
|
|
|
No It Was Help-Full But It Was Related Using By DataSourse, & I Need Answer Related With Using Business Logic (a multiple classes). & Database Was DB2.
|
|
|
|
|
Aight, good luck in finding one
Bastard Programmer from Hell
|
|
|
|
|
hi ,
You can use <item template> along with <table> and <gridview>
kindly search on google "item template with gridviews".
You will get you solution there.
You have to do this coding on .aspx->Source file.
<div class="modified">modified on Friday, June 3, 2011 4:19 PM</div>
|
|
|
|
|
Please edit your answer. You've borked the forums.
|
|
|
|
|
|
Hello
I am not much experienced but I can give you an overview
Protected Sub grdMaster_RowDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles grdMaster.RowDataBound
Dim objListItem As DataControlRowState
objListItem = e.Row.RowState
Dim intMAsterID1 As Integer
If e.Row.RowType = DataControlRowType.DataRow Then
Dim grd As GridView
If objListItem = 5 Then
grd = CType(e.Row.FindControl("grdChildGridEdit"), GridView)
MasterTableID = Convert.ToInt32(CType(e.Row.DataItem, _
DataRowView).Row.ItemArray(0).ToString())
intMAsterID1 = MasterTableID
ElseIf objListItem = DataControlRowState.Normal Or _
objListItem = DataControlRowState.Alternate Then
grd = CType(e.Row.FindControl("grdChildGridNormal"), GridView)
intMAsterID1 = Convert.ToInt32(CType(e.Row.DataItem, _
DataRowView).Row.ItemArray(0).ToString())
Dim lnkButtton As LinkButton
lnkButtton = CType(e.Row.FindControl("Edit"), LinkButton)
If lnkButtton IsNot Nothing Then
lnkButtton.CommandName = "Edit Master"
lnkButtton.CommandArgument = intMAsterID1.ToString
End If
ElseIf objListItem = DataControlRowState.Edit Then
grd = CType(e.Row.FindControl("grdChildGridEdit"), GridView)
MasterTableID = Convert.ToInt32(CType(e.Row.DataItem, _
DataRowView).Row.ItemArray(0).ToString())
intMAsterID1 = MasterTableID
End If
If grd IsNot Nothing Then
grd.DataSourceID = ""
grd.DataSource = ChildDataSource
ChildDataSource.SelectParameters(_
"MasterTableID").DefaultValue = intMAsterID1
ChildDataSource.Select()
grd.DataBind()
End If
End If
End Sub
visit here to solve your .net grid related problem http://www.dapfor.com/Help/NetGrid/Index.aspx[^]
|
|
|
|
|
|
There's a walkthrough[^] on MSDN
Bastard Programmer from Hell
|
|
|
|
|
Hi,
I am working on an MVC application which is written in c#.
I am not able to save the httpposted file to my local folder while running the test case.But the same I am able to run from my controller and its working fine.Pelase find the code below.
string savePath ="c:/test.xlsx";
HttpPostedFileBase uploadedFile = files[0] as HttpPostedFileBase;
uploadedFile.SaveAs(savePath); //not saving the file to the path
can anyone pls help me on this.
Thanks in advance.
|
|
|
|
|
I don't know what operating system you are running, but after Windows XP the root directory has become protected. Software normally can't write to it without acquiring permissions first. Try creating a directory C:\Test and then try saving to C:\Test\Text.xlsx.
Also, you can check the return value or catch exceptions SaveAs throws so you can find out more about the specific error. My guess now is that it would be 'access denied'.
|
|
|
|
|
Was wondering if anyone has bumped into any show-stoppers developing .NET apps using an Apple Mac?
I need to support and develop iPhone, Andriod and Windows Phone apps and I'm thinking this might best be achieved on an Apple with a Windows7 bootcamp. Sounds good, looks good but I couldn't find much on the net re: developer experiences.
Anyone been there, done that?
"You get that on the big jobs."
|
|
|
|
|
So long as your running Windows in a virtual machine, no problem.
|
|
|
|