/**
 *	@brief	Removes one item from the control.
 *	@param[in]	index	item index.
 */
void BeColumnListViewAdapter::RemoveItem(SInt32 index)
{
	BColumnListView* listView = getColumnListView();
	BRow* row = listView->RowAt(index);
	listView->RemoveRow(row);
	delete row;
}
/**
 *	@brief	Sets associated data of specified index.
 *	@param[in]	rowIndex	item index.
 *	@param[in]	data	associated data.
 */
void BeColumnListViewAdapter::SetItemData(SInt32 rowIndex, void* data)
{
	BColumnListView* listView = getColumnListView();
	BeDataRow* row = dynamic_cast<BeDataRow*>(listView->RowAt(rowIndex));
	if (NULL != row)
	{
		return row->SetItemData(data);
	}
}
/**
 *	@brief	Gets a string at specified index from the control.
 *	@param[in]	rowIndex		row index
 *	@param[in]	columnIndex		column index
 *	@param[out]	text	a string value is returned.
 */
void BeColumnListViewAdapter::GetItemText(SInt32 rowIndex, SInt32 columnIndex, MBCString& text)
{
	BColumnListView* listView = getColumnListView();
	BRow* row = listView->RowAt(rowIndex);
	BStringField* field = dynamic_cast<BStringField*>(row->GetField(columnIndex));
	if (NULL != field)
	{
		text = field->String();
	}
}
/**
 *	@brief	Returns associated data of specified index.
 *	@param[in]	rowIndex	item index.
 *	@return	associated data.
 */
void* BeColumnListViewAdapter::GetItemData(SInt32 rowIndex)
{
	BColumnListView* listView = getColumnListView();
	BeDataRow* row = dynamic_cast<BeDataRow*>(listView->RowAt(rowIndex));
	if (NULL != row)
	{
		return row->GetItemData();
	}
	else
	{
		return NULL;
	}
}
/**
 *	@brief	Makes specified item selected.
 *	@param[in]	rowIndex	item index. if this is -1, no item is selected.
 */
void BeColumnListViewAdapter::SetSelectedItem(SInt32 rowIndex)
{
	BColumnListView* listView = getColumnListView();
	BRow* row = listView->RowAt(rowIndex);
	listView->AddToSelection(row);
}