EP / 2009: Grid with some read-only and some editable rows

I have a grid where I need to enable editing for some rows, and other rows should be read-only.

Setting the allowEdit in the active method does not seem to work.

Does anyone know if it is at all possible, and if so, how?

BTW: This forum needs a Enterprise Portal Section.

Solved this one by using two different DataSets and two different grids. One for the read-only data, and another for read-write data.

32 readers and no answers. Seems I need to find a more active forum if I want some answers.

hi,

I was faced with the same problem and (after a long time of experimenting) I think I found a solution.

basically, in the event of the grid Pre_Render (which gets called everytime you click on the grid) you can disable the grid (enabled = false).

Hi Tommy,

Remember, when you drag and drop a field into grid, that field in the grip showed as an element in that form.

In the form, that element becomes a field but it performs as display the content of data where you can visible and invisible, colour background, etc…

If you want control the user access then you should consider to security-key and configuration-key in that grid.

The most important part is the “Allowedit” in the table. This table must be open from the AOT to see the field property and able to change.

If you open this table in your form then the fields could not be edit or change.

I hope above explanation can help.

cheers,

Minh

Hi friend,

Add a new action menu, and write a code on action menu as like grid edite on selected row.

Thanks

chadresh

Hi tommy,

You can try using this.

public partial class AxWebUserControl : System.Web.UI.UserControl

{

void Page_Init(object sender, EventArgs e)

{

this.AxGridView1.SelectedIndexChanged += new EventHandler(AxGridView1_SelectedIndexChanged);

}

void AxGridView1_SelectedIndexChanged(object sender, EventArgs e)

{

this.EnableGridEditing(this.IsCurrentAccountNumberEven());

}

private void EnableGridEditing(bool enable)

{

if (enable)

{

this.AxGridView1.AllowEdit = true;

this.AxGridView1.EditIndex = this.AxGridView1.SelectedIndex;

}

else

{

this.AxGridView1.EditIndex = -1;

this.AxGridView1.AllowEdit = false;

}

}

private bool IsCurrentAccountNumberEven()

{

DataSet dataSet = this.CustomersInfoDS.GetDataSet();

DataSetViewRow currentRow = dataSet.DataSetViews[this.AxGridView1.DataMember].GetCurrent();

if (currentRow != null)

{

string accountNumberStr = (string)currentRow.GetFieldValue(“AccountNum”);

if (!string.IsNullOrEmpty(accountNumberStr))

{

int accountNumber = Int32.Parse(accountNumberStr);

return accountNumber % 2 == 0;

}

}

return false;

-Rajee