Click here to Skip to main content
15,885,670 members
Home / Discussions / C#
   

C#

 
AnswerRe: data akses to mySql using c# Pin
kid sister24-Feb-12 18:22
kid sister24-Feb-12 18:22 
QuestionCompress with java decompress with c# Pin
Hossein Khalaj24-Feb-12 2:46
Hossein Khalaj24-Feb-12 2:46 
AnswerRe: Compress with java decompress with c# Pin
Eddy Vluggen24-Feb-12 8:42
professionalEddy Vluggen24-Feb-12 8:42 
AnswerRe: Compress with java decompress with c# Pin
Bernhard Hiller26-Feb-12 20:32
Bernhard Hiller26-Feb-12 20:32 
QuestionReading Null values in a byte array Pin
si_6924-Feb-12 1:24
si_6924-Feb-12 1:24 
AnswerRe: Reading Null values in a byte array Pin
Dave Kreskowiak24-Feb-12 4:07
mveDave Kreskowiak24-Feb-12 4:07 
AnswerRe: Reading Null values in a byte array Pin
Matt Meyer24-Feb-12 5:21
Matt Meyer24-Feb-12 5:21 
QuestionHow to filter record when combobox value is null Pin
polachan24-Feb-12 0:56
polachan24-Feb-12 0:56 
The record in datagridview is filtered on the basis of the value selected from combobox . How I can filter the record from datagridview when the combo box selected value is null.
example : combox contain ProductGrade. So the value exists in combobox is 'A','B' and may come null value.But When I select just null value, the record is not filtering. Pls help how to filter record having null value ProductGrade

Here is the code

protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e){
base.OnFilterExpressionBuilding(sender, e);
if (e.Cancel) {
FilterManager.RebuildFilter();
return;
}

string ResultFilterExpression = "";
string ResultFilterCaption = OriginalDataGridViewColumnHeaderText ;
// object FilterValue = comboBoxValue.SelectedValue;
object FilterValue = comboBoxValue.Text;
FilterValue = StringEscape(FilterValue.ToString());
//StringEscape(FilterValue);
// Managing the NULL and NOT NULL cases which are type-independent
if (comboBoxOperator.Text == "xxx..") ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " LIKE '" + FilterValue + "%'";
if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);

Pls Help

if (ResultFilterExpression != "") {
FilterExpression = ResultFilterExpression;
FilterCaption = ResultFilterCaption + "\n " + comboBoxOperator.Text;
FilterManager.RebuildFilter();
return;
}


string FormattedValue = "";

if (ColumnDataType == typeof(string)) {
// Managing the string-column case
string EscapedFilterValue = StringEscape(FilterValue.ToString());
ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + "'" + EscapedFilterValue + "'";
ResultFilterCaption += "\n" + comboBoxOperator.Text + " " + comboBoxValue.Text;
}
else {
// Managing the other cases
FormattedValue = FormatValue(FilterValue, this.ColumnDataType);
if (FormattedValue != "") {
ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue ;
ResultFilterCaption += "\n" + comboBoxOperator.Text + " " + comboBoxValue.Text ;
}

}
if (ResultFilterExpression != "") {
FilterExpression = ResultFilterExpression;
FilterCaption = ResultFilterCaption;
FilterManager.RebuildFilter();
}
}
AnswerRe: How to filter record when combobox value is null Pin
Bernhard Hiller26-Feb-12 20:39
Bernhard Hiller26-Feb-12 20:39 
Questionaccessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 0:10
Fred 3424-Feb-12 0:10 
AnswerRe: accessing the value of control between seperate Forms Pin
Smart Arab24-Feb-12 0:24
Smart Arab24-Feb-12 0:24 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 0:36
Fred 3424-Feb-12 0:36 
AnswerRe: accessing the value of control between seperate Forms Pin
Richard MacCutchan24-Feb-12 1:26
mveRichard MacCutchan24-Feb-12 1:26 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 1:44
Fred 3424-Feb-12 1:44 
GeneralRe: accessing the value of control between seperate Forms Pin
lukeer24-Feb-12 2:10
lukeer24-Feb-12 2:10 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 4:40
Fred 3424-Feb-12 4:40 
GeneralRe: accessing the value of control between seperate Forms Pin
Richard MacCutchan24-Feb-12 2:44
mveRichard MacCutchan24-Feb-12 2:44 
AnswerRe: accessing the value of control between seperate Forms Pin
Dave Kreskowiak24-Feb-12 4:12
mveDave Kreskowiak24-Feb-12 4:12 
GeneralRe: accessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 4:46
Fred 3424-Feb-12 4:46 
GeneralRe: accessing the value of control between seperate Forms Pin
Dave Kreskowiak24-Feb-12 9:03
mveDave Kreskowiak24-Feb-12 9:03 
AnswerRe: accessing the value of control between seperate Forms Pin
Shameel24-Feb-12 8:25
professionalShameel24-Feb-12 8:25 
Questionhow to filter chart by textbox & dropdown ??? Pin
Jeeten Parmar24-Feb-12 0:08
Jeeten Parmar24-Feb-12 0:08 
QuestionExport To word problem Pin
helmidj23-Feb-12 22:16
helmidj23-Feb-12 22:16 
AnswerRe: Export To word problem Pin
Pete O'Hanlon23-Feb-12 22:24
mvePete O'Hanlon23-Feb-12 22:24 
GeneralRe: Export To word problem Pin
helmidj27-Feb-12 4:37
helmidj27-Feb-12 4:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.