|
I have a ListView set to details mode, which contains file paths. Is it possible to truncate the cells from the left hand side instead of the right?
For example:
If a cell contains a string (C:\Windows\Some directory\file.txt), then if the column is too small, the cell just reads C:\Windows\So...
I need it to truncate from the other side, so it reads ...ctory\file.txt. Is this possible?
|
|
|
|
|
It's not supported natively. You'd have to come up with your own implmentation of the ListView control and replace the drawing code to support this.
|
|
|
|
|
|
What is the use of MVC architecture
|
|
|
|
|
Clean separation of model,view and controller. Easy to maintain and many more.
|
|
|
|
|
|
|
|
Hi All,
in one (windows)form im binding the table to datagridview ,with check box
column . if i click check box in one column , i want to display the
content of that row in a new window ...
in which event we have to write the code .., give me samples or tell me how to write ..!!
thanks .
|
|
|
|
|
Hi,
You can use the CellEndEdit() event for DataGridView. You can probably take a look at the given code.
Lets say we have a grid with first column as boolen column. You have another form2 with a property
GetDataRow() to receive the DataGridView row. In this scenario, you can put the following code under
CellEndEdit() event.
<br />
if (e.ColumnIndex == 0) <br />
{ <br />
<br />
DataRow dr; <br />
<br />
if (DataGridView1(e.ColumnIndex, e.RowIndex).Value == false) <br />
{ <br />
<br />
Form2 frm = new Form2(); <br />
frm.GetDataRow = DataGridView1.Rows[e.RowIndex];
frm.ShowDialog(); <br />
<br />
} <br />
} <br />
I hope this helps.
Regards,
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
thanks ,
i will try this code
regards,
csn.
|
|
|
|
|
Hello friends,
I am developing an windows application setup project using setup wizard.
now what i want to add uninstall feature in setup application.
So how can i add uninstall feature to setup project...
|
|
|
|
|
Add the Following to the beginning of your Applications Main()
<br />
# region For UnInstaller<br />
string[] arguments = Environment.GetCommandLineArgs();<br />
foreach (string argument in arguments)<br />
{<br />
if (argument.Split('=')[0].ToLower() == "/u")<br />
{<br />
string guid = argument.Split('=')[1];<br />
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);<br />
ProcessStartInfo si = new ProcessStartInfo(path + "\\msiexec.exe", "/x " + guid);<br />
Process.Start(si);<br />
Application.Exit();<br />
Environment.Exit(0);<br />
}<br />
}<br />
# endregion<br />
Go to the Installer project and add a shortcut to the Primary output and rename it to
Uninstall <Application Name>
Go to the Properties of the newly added shortcut and Set the Arguments property to
"/u=[ProductCode]"
Place the shortcut in the user's programs menu.
Create a build and your application is ready with Uninstaller.
thanks
kss
|
|
|
|
|
hi friends....
i am used one single line textbox for getting values.. When the enter button press the single line textbox is changed to
multi line textbox and also create one new line... but the cursor always gets back to right upper corner of the textbox instead of staying in the new line position...How can i set cursor position to new line....
|
|
|
|
|
Aravinthan wrote: When the enter button press the single line textbox is changed to
multi line textbox
No, it's not. The user hitting enter does not change the behavior of the TextBox. Are you sure you didn't set the MultiLine property of the TextBox to true, and then in the design make it LOOK like it's only one line high??
|
|
|
|
|
i set the MultiLine property of the TextBox to true at the time of key(Enter key) down and i create one new line txtbox1.Text+Environment.NewLine.....but the cursor is in upper left corner of the textbox...
|
|
|
|
|
Aravinthan wrote: i set the MultiLine property of the TextBox to true at the time of key(Enter key) down
OK. I fail to see how this is useful. Why would you do something like this?
Did you also set the TextBox's AcceptsEnter property to true?? Did you look into the TextBox's SelectionStart property? This sets the position of the insertion point (blinking cursor).
|
|
|
|
|
Hello,
I'm trying to execute the following mechanism ..
>>>>> get records from the DB , ( e.g. record for each product )
>>>>> create a "link label" for each record ( product )
>>>>> when any of the link labels is clicked .. it assign the ProductID value from the record to a Global variable named ProductID
>>>>> add all the link lables to a panel
that's what've done, My problem is that i always get the value of the last record
<br />
DataTable dtUserOffers = ProductsQuery;<br />
<br />
int NewY = 0;<br />
<br />
for ( i = 0; i < dtUserOffers.Rows.Count; i++)<br />
{<br />
<br />
LinkLabel lnkUserOffers = new LinkLabel();<br />
<br />
<br />
lnkUserOffers.AutoSize = true;<br />
lnkUserOffers.Location = new System.Drawing.Point(18, NewY);<br />
lnkUserOffers.Name = "lnkUserOffers" + i.ToString();<br />
lnkUserOffers.Size = new System.Drawing.Size(59, 14);<br />
lnkUserOffers.TabStop = true;<br />
lnkUserOffers.Text = "View";<br />
<br />
<br />
Global.Product_id = int.Parse(dtUserOffers.Rows[i]["ProductID"].ToString());<br />
<br />
EventHandler handler = new EventHandler(LinkLabel_Click);<br />
<br />
lnkUserOffers.Click += handler;<br />
<br />
NewY += 15;<br />
<br />
panel1.Controls.Add(lnkUserOffers);<br />
<br />
}<br />
<br />
<br />
private void LinkLabel_Click(object sender, EventArgs e)<br />
{<br />
<br />
MessageBox.Show(Global.ProductID);<br />
<br />
}
How can i Handle this an assign a specific action to each created link label
|
|
|
|
|
you may use anonumous methods and closure .
// you can use method with no name this is delegate (args ){} aka anonymous methodes
EventHandler handler = new EventHandler (new delegate (object sender,EventArgs e){
MessageBox.Show(Global.ProductID); // you can use variables global that is closure
}))
or you can use command objects this is objects that actually encapsulate a method
ec
ClickCommand command = new ClickCommand(product_id)
EventHandler handler = new EventHandler (command.ExecuteOnClickAction);
where
class Clickcommand
{
int productid;
public void ExecuteOnClickAction()
{
MessageBox.Show(productID);
}
}
or many more improvise
f(yf) = yf
|
|
|
|
|
hi all
in my application iam having a grid which contains a check box at the top and name field inside and check boxes to select the particular name.(like in mail boxes).i can select the particular checkbox if i want..till here no problem..but if i want to select all the check boxes by clicking the check box at the top(note this has to be done by clicking the check box and not by any buttons like unread button as in gmail or yahoo).can anyone give me code to do it...
thanks in advance..
pintoo
|
|
|
|
|
|
hi i have tried this link...it is not working ..iam giving the code herewith.do tell me what iam missing..
ASPX PAGE
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head runat="server"><br />
<title>Untitled Page</title><br />
<script language="javascript" type="text/javascript"><br />
function SelectAll(idHeaderCheckbox)<br />
{ <br />
var checkboxHeader = document.getElementById(idHeaderCheckbox);<br />
var hdnCheckboxIDs = document.getElementById("hdnCheckboxID") ;<br />
var arrCheckboxIDs = hdnCheckboxIDs.value.split(",");<br />
<br />
if(checkboxHeader.checked == true)<br />
{<br />
for(var i=0 ; i < arrCheckboxIDs.length ; i++ )<br />
{<br />
if(arrCheckboxIDs[i] != "")<br />
{<br />
var ckbItem = document.getElementById(arrCheckboxIDs[i]);<br />
ckbItem.checked = true;<br />
}<br />
}<br />
}<br />
else if(checkboxHeader.checked == false)<br />
{<br />
for(var i=0 ; i < arrCheckboxIDs.length ; i++ )<br />
{<br />
if(arrCheckboxIDs[i] != "")<br />
{<br />
var ckbItem = document.getElementById(arrCheckboxIDs[i]);<br />
ckbItem.checked = false;<br />
}<br />
}<br />
}<br />
}<br />
</script><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"><br />
<Columns><br />
<asp:TemplateField><br />
<HeaderTemplate><br />
<asp:CheckBox ID="ckbHeader" runat="server" /><br /><br />
</HeaderTemplate><br />
<ItemTemplate><br />
<asp:CheckBox ID="ckbItem" runat="server" /><br /><br />
</ItemTemplate><br />
</asp:TemplateField><br />
<asp:BoundField DataField="Name" HeaderText="Emp Name" /><br />
<asp:BoundField DataField="EmpID" HeaderText="Emp Id" /><br />
<asp:BoundField DataField="Age" HeaderText="Emp Age" /><br />
</Columns><br />
</asp:GridView><br />
<input type="hidden" id="hdnCheckboxID" runat="server" /><br />
</div><br />
</form><br />
</body><br />
</html>
code behind file..
protected void Page_Load(object sender, EventArgs e)
{
BindGrid();
}
private void BindGrid()
{
string Connstr = "connection string"
SqlConnection Conn = new SqlConnection(Connstr);
string str = "select * from employee";
SqlCommand cmd = new SqlCommand(str,Conn);
Conn.Open();
DataSet ds = new DataSet();
SqlDataAdapter Adap = new SqlDataAdapter();
Adap.SelectCommand = cmd;
Adap.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
CheckBox ckbHeader = e.Row.Cells[0].FindControl("ckbHeader") as CheckBox;
ckbHeader.Attributes.Add("onclick", "SelectAll(" + ckbHeader.ClientID.ToString() + ")");
}
else if(e.Row.RowType==DataControlRowType.DataRow)
{
CheckBox ckbItem = new CheckBox();
ckbItem = e.Row.Cells[0].FindControl("ckbItem") as CheckBox;
hdnCheckboxID.Value += ckbItem.ClientID + ",";
}
}
pintoo
|
|
|
|
|
Hi,
Just make the following two changes and it will work.
update this line
ckbHeader.Attributes.Add("onclick", "SelectAll(" + ckbHeader.ClientID.ToString() + ")");
to
ckbHeader.Attributes.Add("onclick", "SelectAll(this)");
and update this javascript line
var checkboxHeader = document.getElementById(idHeaderCheckbox);
to
var checkboxHeader = idHeaderCheckbox;
Do let me know if u need more info,
Cheers...
|
|
|
|
|
hi vimal raj
it is working perfectly..thanx for your valuable suggestion and your time.
pintoo
|
|
|
|
|
i want to make a remote backup server. plz send me c# example related to remote backup server.
regards
modified on Tuesday, March 25, 2008 11:43 AM
|
|
|
|