|
Well that's simple: Just use Path.GetDirectoryName() to get only the directory.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
i will tell in detail.if we write some no of collections(property) in dropdownlist it is displaying full length but i want the length should be reduced means i should get get scrolling.
|
|
|
|
|
I want to print many pages one times,but the print result was wrong!the print Height was small than my degsin heigth!
my report's properties set like these:
Report Property:
InteractiveWidth:21cm
InteractiveHeight:13.9cm
MarinTop .5cm
MarinLeft .2cm
MarinRight .2cm
MarinBottom .5cm
PageHeight:21cm
PageWidth:13.9cm
Body Property:
Height:21.1cm
Width:12.9cm
Table Property:
PageBreakAtStart:false
PageBreakAtEnd :True
I see some document write like this:"If the PageHeight is less than the PageWidth, then it is landscape, otherwise it is portrait.While you can programmatically change these via the SetProperties method on the web service, they will be overwritten if the report is republished. "
I change the Print Pages Format and size ,select portrait and set height 13.9cm ,set width 21.5cm,but the print Browse is not change,why?
The Print Result is wrong ,the Print Result width is right,but the
height is wrong ,is small than 13.9cm,only 7cm ,the Font was small too.
who can help me?tell me why?
|
|
|
|
|
Hi All ,
I am having the problem in setup deployment of windows application,ie:at present i am installing the s/w or setup file seperately ,framework and database saperately.but i want to make setup,which should contain framework setup,application setup and database.In a clear,when i install the setup( contains framework setup,application setup and database) in any machine it should automatically install the framework if it does not have the framework and it will install the application and create complete
database by simply clicking next...next buttons.
wheather i can do this,if possible plz give me the description and clear way of setup. I am also using the .dll of MS Enterprise Library for building the .config files and SQL 2005 express edition.
Thank You,
Mithun
|
|
|
|
|
Take a look at the NSIS project[^]. Its an easy-to-learn and in my opinion very useful open source system for creation of Windows installers. Among many others the web site provides a code example for Installing the Microsoft .NET Framework[^].
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I am working within a DataGrid and would like to select a whole row when the user clicks anywhere in the row. I am not sure how to accomplish this and would like some direction.
Best of luck,
Michael Baker
|
|
|
|
|
This code will help u to get the whole row of the grid selected when u click a check box in the corresponding rows of the grid. Hope this solves ur issue.
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace solCommon.Web.UI.DataGrid
{
///
/// CheckBoxColumn Derives from DataGrid Column
///
public class DGCheckBoxColumn : DataGridColumn
{
public DGCheckBoxColumn(): base()
{
}
public override void InitializeCell(TableCell cell,
int columnIndex, ListItemType itemType)
{
//let the base class initialize the cell
base.InitializeCell(cell, columnIndex, itemType);
if( itemType == ListItemType.EditItem ||
itemType == ListItemType.Item ||
itemType == ListItemType.AlternatingItem ||
itemType == ListItemType.SelectedItem ||
itemType == ListItemType.Header)
{
CheckBox checkbox = new CheckBox();
//assign an ID that we can use to find the control later
//we don't want to add a normal checkbox to the header.
checkbox.ID = (itemType==ListItemType.Header)? "checkboxHead": "checkboxCol";
cell.Controls.Add(checkbox);
}
}
public Int32[] SelectedIndexes
{
get
{
ArrayList selectedIndexList = new ArrayList();
//iterate each DataGridItem and find our checkbox
foreach( DataGridItem item in this.Owner.Items )
{
CheckBox chkBox =
(CheckBox) item.FindControl("checkboxCol");
//If it's selected then add it to our ArrayList
if ( chkBox != null && chkBox.Checked )
{
selectedIndexList.Add( item.ItemIndex );
}
}
return (Int32[])selectedIndexList.ToArray(typeof(
System.Int32 ) );
}
}
public object[] SelectedDataKeys
{
get
{
//Just iterate each of the selectedindexes and
//match it up to the datakey field
ArrayList dataKeyList = new ArrayList();
//make sure the datakeys have some values
if(this.Owner.DataKeys.Count > 0)
{
foreach( Int32 selectedIndex in SelectedIndexes )
{
object DataKey =
(this.Owner.DataKeys[selectedIndex].ToString());
dataKeyList.Add(DataKey);
}
}
return (object[])dataKeyList.ToArray(typeof( object ) );
}
}
public static void RegisterClientCheckEvents(Page pg, string formID)
{
string strCol = GetCheckColScript();
string strHead = GetCheckHeadScript();
if(!pg.IsClientScriptBlockRegistered("clientScriptCheckAll"))
pg.RegisterClientScriptBlock("clientScriptCheckAll", strHead.Replace("[frmID]",formID));
if(!pg.IsClientScriptBlockRegistered("clientScriptCheckChanged"))
pg.RegisterClientScriptBlock("clientScriptCheckChanged", strCol.Replace("[frmID]",formID));
RegisterAttributes(pg);
}
private static void RegisterAttributes(Control ctrl)
{
foreach (Control wc in ctrl.Controls)
{
try
{
if ( wc.HasControls() )
RegisterAttributes(wc);
CheckBox chk = (CheckBox)wc;
if (chk != null && chk.ID == "checkboxCol")
{
chk.Attributes.Add("onclick","CheckChanged()");
}
else if ( chk != null && chk.ID == "checkboxHead")
{
chk.Attributes.Add("onclick","CheckAll(this)");
}
}
catch
{
}
}
}
private static string GetCheckColScript()
{
string strScript;
strScript= " ";
strScript+=" function CheckAll( checkAllBox )";
strScript+=" {";
strScript+=" var frm = document.[frmID];";
strScript+=" var ChkState=checkAllBox.checked;";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if(e.type=='checkbox' && e.name.indexOf('checkboxCol') != -1)";
strScript+=" e.checked= ChkState ;";
strScript+=" }";
strScript+=" }";
strScript+=" ";
return strScript;
}
private static string GetCheckHeadScript()
{
string strScript="";
strScript= "";
strScript+="function CheckChanged()";
strScript+="{";
strScript+=" var frm = document.[frmID];";
strScript+=" var boolAllChecked;";
strScript+=" boolAllChecked=true;";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if ( e.type=='checkbox' && e.name.indexOf('checkboxCol') != -1 )";
strScript+=" if(e.checked== false)";
strScript+=" {";
strScript+=" boolAllChecked=false;";
strScript+=" break;";
strScript+=" }";
strScript+=" }";
strScript+=" for(i=0;i< frm.length;i++)";
strScript+=" {";
strScript+=" e=frm.elements[i];";
strScript+=" if ( e.type=='checkbox' && e.name.indexOf('checkboxHead') != -1 )";
strScript+=" {";
strScript+=" if( boolAllChecked==false)";
strScript+=" e.checked= false ;";
strScript+=" else";
strScript+=" e.checked= true;";
strScript+=" break;";
strScript+=" }";
strScript+=" }";
strScript+=" }";
strScript+=" ";
return strScript;
}
}
}
Vipin
|
|
|
|
|
I have a main form that is set to auto scroll so that when lower screen resoloutions are used, scroll bars are provided. The controls are not getting set back to position 0,0 but are displaying where ever the last scroll bar displayed the previouse control. Any way to get the controls to reset to display back at 0,0 and the bottom scroll bar to reset back to the left and the right one back to the top?
|
|
|
|
|
Hi guys what is wrong with this line? lookupObject is a struct. I just want to initialize the dictionary with the struct as value.
public static Dictionary<string, lookupojbect=""> dicTextLookup = new Dictionary<string, lookupojbect="">();
this is the error: "Error 1 Inconsistent accessibility: field type 'System.Collections.Generic.Dictionary<string,lookupojbect>' is less accessible than field 'dicTextLookup' C:\IL\TranslationController.cs 44"
Thanks
|
|
|
|
|
Could you repost that snippet, but check the "Ignore HTML tags in this message" checkbox when posting? We can't see your full code otherwise.
Is dicTextLookup non-public? Are you exposing the field as public? This error typically occurs if you're trying to expose some private/protected/internal thing as public. For instance
private class MyFoo {}
public class MyBar()
{
public MyFoo instance;
}
|
|
|
|
|
Sorry I didnt know about checking the checkbox, you solved my problem without looking at my code. Great!
|
|
|
|
|
How can I verify that the input in a textbox is numeric?
Jude
|
|
|
|
|
You could use a regular expression, something like RegEx("[0-9]")
only two letters away from being an asset
|
|
|
|
|
Could you point me in the right directioon on how to use RegEx?
Thanx
Jude
|
|
|
|
|
|
try to parse it, between try and catch and if rise exception isnt number
God make a perfect team, the rest have foreigners, Athletic Club Bilbao
|
|
|
|
|
How do I implement this method?
Jude
|
|
|
|
|
Don't implement it that way. Exceptions should be used only for exceptional circumstances, not part of normal code flow.
Rather than doing that, either us a MaskedTextBox (new in .NET 2.0) or use a regular expression to validate the input.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
When using Framework 2.0 you could use MaskedTextBox .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Include the Visual Basic library and use the IsNumeric method.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
|
|
Greeeg wrote: a sorted list via a listbox control
|
|
|
|
|
Here is an easy way that doesn't rely on exceptions, regular expressions, or legacy VB libraries:
double numericValue;
bool isNumeric = double.TryParse(myTextBox.Text, out numericValue);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Unfortunately there's no int.TryParse method to accompany that one.
|
|
|
|